|
|||||||||
| Home >> All >> org >> apache >> [ xmlbeans overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
org.apache.xmlbeans
Class XmlValidationError

java.lang.Objectorg.apache.xmlbeans.XmlError
org.apache.xmlbeans.XmlValidationError
- All Implemented Interfaces:
- java.io.Serializable
- public class XmlValidationError
- extends XmlError
The XmlValidationError class extends the XmlErrorXMLError class. The XML Validator contains extra attributes that can be used to construct the XML validation error programatically.
To extract the validation error cast the errors to XmlValidationError instead of
XmlError for example:
xobj.validate(new XmlOptions().setErrorListener(errors))
for (Iterator it = errors.iterator(); it.hasNext(); )
{
XmlError err = (XmlError)it.next());
if (err instanceof XmlValidationError)
{
XmlValidationError validationError = (XmlValidationError) err;
}
}
Whenever an XmlValidationError is retrieved it will always be populated with
the following information:
- Message
- Severity
- Error Type
The error type is very important because the other attributes of the XMLValidationError are populated based on the error type.
if errortype == INCORRECT_ELEMENT thenoffendingQName, badSchemaType will always be present, however expectedSchemaType and expectedQNames are available only if it is possible to determine them during vaildation.
if errortype == ELEMENT_NOT_ALLOWED then
badSchemaType will always be present, however expectedSchemaType and
offendingQName are available only if it is possible to determine them during vaildation.
if errortype == INCORRECT_ATTRIBUTE then
offendingQName, badSchemaType will always be present
if errortype == ATTRIBUTE_TYPE_INVALID then
no other addtional attributes are populated
if errortype == LIST_INVALID then
expectedSchemaType will always be present
if errortype == UNION_INVALID then
expectedSchemaType will always be present
if errortype == NIL_ELEMENT then
offendingQName, expectedSchemaType and badSchemaType will always be present
if errortype == ELEMENT_TYPE_INVALID then
offendingQName will always be present, other attributes may be available
| Field Summary | |
private SchemaType |
_badSchemaType
|
private int |
_errorType
|
private java.util.List |
_expectedQNames
|
private SchemaType |
_expectedSchemaType
|
private javax.xml.namespace.QName |
_fieldQName
|
private javax.xml.namespace.QName |
_offendingQName
|
static int |
ATTRIBUTE_TYPE_INVALID
|
static int |
ELEMENT_NOT_ALLOWED
|
static int |
ELEMENT_TYPE_INVALID
|
static int |
INCORRECT_ATTRIBUTE
|
static int |
INCORRECT_ELEMENT
|
static int |
LIST_INVALID
|
static int |
NIL_ELEMENT
|
static int |
UNDEFINED
|
static int |
UNION_INVALID
|
| Fields inherited from class org.apache.xmlbeans.XmlError |
SEVERITY_ERROR, SEVERITY_INFO, SEVERITY_WARNING |
| Constructor Summary | |
private |
XmlValidationError(java.lang.String message,
int severity,
javax.xml.stream.Location loc,
javax.xml.namespace.QName fieldQName,
javax.xml.namespace.QName offendingQname,
SchemaType expectedSchemaType,
java.util.List expectedQNames,
int errorType,
SchemaType badSchemaType)
The static factory methods should be used instead of this constructor. |
private |
XmlValidationError(java.lang.String message,
int severity,
XmlCursor cursor,
javax.xml.namespace.QName fieldQName,
javax.xml.namespace.QName offendingQname,
SchemaType expectedSchemaType,
java.util.List expectedQNames,
int errorType,
SchemaType badSchemaType)
The static factory methods should be used instead of this constructor. |
private |
XmlValidationError(java.lang.String code,
java.lang.Object[] args,
int severity,
javax.xml.stream.Location loc,
javax.xml.namespace.QName fieldQName,
javax.xml.namespace.QName offendingQname,
SchemaType expectedSchemaType,
java.util.List expectedQNames,
int errorType,
SchemaType badSchemaType)
The static factory methods should be used instead of this constructor. |
private |
XmlValidationError(java.lang.String code,
java.lang.Object[] args,
int severity,
XmlCursor cursor,
javax.xml.namespace.QName fieldQName,
javax.xml.namespace.QName offendingQname,
SchemaType expectedSchemaType,
java.util.List expectedQNames,
int errorType,
SchemaType badSchemaType)
The static factory methods should be used instead of this constructor. |
| Methods inherited from class org.apache.xmlbeans.XmlError |
forCursor, forCursor, forCursor, forCursor, forLocation, forLocation, forLocation, forLocation, forLocationAndCursor, formattedFileName, formattedMessage, forMessage, forMessage, forMessage, forMessage, forObject, forObject, forObject, forObject, forSource, forSource, forSource, getColumn, getCursorLocation, getErrorCode, getLine, getLocation, getObjectLocation, getOffset, getSeverity, getSourceName, severityAsString, toString, toString |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
INCORRECT_ELEMENT
public static final int INCORRECT_ELEMENT
- See Also:
- Constant Field Values
ELEMENT_NOT_ALLOWED
public static final int ELEMENT_NOT_ALLOWED
- See Also:
- Constant Field Values
ELEMENT_TYPE_INVALID
public static final int ELEMENT_TYPE_INVALID
- See Also:
- Constant Field Values
NIL_ELEMENT
public static final int NIL_ELEMENT
- See Also:
- Constant Field Values
INCORRECT_ATTRIBUTE
public static final int INCORRECT_ATTRIBUTE
- See Also:
- Constant Field Values
ATTRIBUTE_TYPE_INVALID
public static final int ATTRIBUTE_TYPE_INVALID
- See Also:
- Constant Field Values
LIST_INVALID
public static final int LIST_INVALID
- See Also:
- Constant Field Values
UNION_INVALID
public static final int UNION_INVALID
- See Also:
- Constant Field Values
UNDEFINED
public static final int UNDEFINED
- See Also:
- Constant Field Values
_fieldQName
private javax.xml.namespace.QName _fieldQName
_offendingQName
private javax.xml.namespace.QName _offendingQName
_expectedSchemaType
private SchemaType _expectedSchemaType
_expectedQNames
private java.util.List _expectedQNames
_errorType
private int _errorType
_badSchemaType
private SchemaType _badSchemaType
| Constructor Detail |
XmlValidationError
private XmlValidationError(java.lang.String message, int severity, XmlCursor cursor, javax.xml.namespace.QName fieldQName, javax.xml.namespace.QName offendingQname, SchemaType expectedSchemaType, java.util.List expectedQNames, int errorType, SchemaType badSchemaType)
- The static factory methods should be used instead of
this constructor.
XmlValidationError
private XmlValidationError(java.lang.String code, java.lang.Object[] args, int severity, XmlCursor cursor, javax.xml.namespace.QName fieldQName, javax.xml.namespace.QName offendingQname, SchemaType expectedSchemaType, java.util.List expectedQNames, int errorType, SchemaType badSchemaType)
- The static factory methods should be used instead of
this constructor.
XmlValidationError
private XmlValidationError(java.lang.String message, int severity, javax.xml.stream.Location loc, javax.xml.namespace.QName fieldQName, javax.xml.namespace.QName offendingQname, SchemaType expectedSchemaType, java.util.List expectedQNames, int errorType, SchemaType badSchemaType)
- The static factory methods should be used instead of
this constructor.
XmlValidationError
private XmlValidationError(java.lang.String code, java.lang.Object[] args, int severity, javax.xml.stream.Location loc, javax.xml.namespace.QName fieldQName, javax.xml.namespace.QName offendingQname, SchemaType expectedSchemaType, java.util.List expectedQNames, int errorType, SchemaType badSchemaType)
- The static factory methods should be used instead of
this constructor.
| Method Detail |
forCursorWithDetails
public static XmlValidationError forCursorWithDetails(java.lang.String message, java.lang.String code, java.lang.Object[] args, int severity, XmlCursor cursor, javax.xml.namespace.QName fieldQName, javax.xml.namespace.QName offendingQname, SchemaType expectedSchemaType, java.util.List expectedQNames, int errorType, SchemaType badSchemaType)
forLocationWithDetails
public static XmlValidationError forLocationWithDetails(java.lang.String message, java.lang.String code, java.lang.Object[] args, int severity, javax.xml.stream.Location location, javax.xml.namespace.QName fieldQName, javax.xml.namespace.QName offendingQname, SchemaType expectedSchemaType, java.util.List expectedQNames, int errorType, SchemaType badSchemaType)
getMessage
public java.lang.String getMessage()
- Description copied from class:
XmlError - Returns the error message without location information.
- Overrides:
getMessagein classXmlError
getBadSchemaType
public SchemaType getBadSchemaType()
setBadSchemaType
public void setBadSchemaType(SchemaType _badSchemaType)
getErrorType
public int getErrorType()
setErrorType
public void setErrorType(int _errorType)
getExpectedQNames
public java.util.List getExpectedQNames()
setExpectedQNames
public void setExpectedQNames(java.util.List _expectedQNames)
getFieldQName
public javax.xml.namespace.QName getFieldQName()
setFieldQName
public void setFieldQName(javax.xml.namespace.QName _fieldQName)
getOffendingQName
public javax.xml.namespace.QName getOffendingQName()
setOffendingQName
public void setOffendingQName(javax.xml.namespace.QName _offendingQName)
getExpectedSchemaType
public SchemaType getExpectedSchemaType()
setExpectedSchemaType
public void setExpectedSchemaType(SchemaType _expectedSchemaType)
|
|||||||||
| Home >> All >> org >> apache >> [ xmlbeans overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
JAVADOC