Package net.n3.nanoxml
Class XMLValidationException
java.lang.Object
java.lang.Throwable
java.lang.Exception
net.n3.nanoxml.XMLException
net.n3.nanoxml.XMLValidationException
- All Implemented Interfaces:
Serializable
An XMLValidationException is thrown when the XML passed to the XML parser is
well-formed but not valid.
- Author:
- Marc De Scheemaecker
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
An attribute has an invalid value.static final int
Another error than those specified in this class was encountered.static final int
An attribute was missing.static final int
An element was missing.static final int
A PCDATA element was missing.static final int
An unexpected attribute was encountered.static final int
An unexpected element was encountered.static final int
An unexpected PCDATA element was encountered. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
finalize()
Cleans up the object when it's destroyed.Returns the name of the attribute in which the validation is violated.Returns the value of the attribute in which the validation is violated.Returns the name of the element in which the validation is violated.Methods inherited from class net.n3.nanoxml.XMLException
getException, getLineNr, getSystemID, printStackTrace, printStackTrace, printStackTrace, toString
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, setStackTrace
-
Field Details
-
MISSING_ELEMENT
public static final int MISSING_ELEMENTAn element was missing.- See Also:
-
UNEXPECTED_ELEMENT
public static final int UNEXPECTED_ELEMENTAn unexpected element was encountered.- See Also:
-
MISSING_ATTRIBUTE
public static final int MISSING_ATTRIBUTEAn attribute was missing.- See Also:
-
UNEXPECTED_ATTRIBUTE
public static final int UNEXPECTED_ATTRIBUTEAn unexpected attribute was encountered.- See Also:
-
ATTRIBUTE_WITH_INVALID_VALUE
public static final int ATTRIBUTE_WITH_INVALID_VALUEAn attribute has an invalid value.- See Also:
-
MISSING_PCDATA
public static final int MISSING_PCDATAA PCDATA element was missing.- See Also:
-
UNEXPECTED_PCDATA
public static final int UNEXPECTED_PCDATAAn unexpected PCDATA element was encountered.- See Also:
-
MISC_ERROR
public static final int MISC_ERRORAnother error than those specified in this class was encountered.- See Also:
-
-
Constructor Details
-
XMLValidationException
public XMLValidationException(int errorType, String systemID, int lineNr, String elementName, String attributeName, String attributeValue, String msg) Creates a new exception.- Parameters:
errorType
- the type of validity errorsystemID
- the system ID from where the data camelineNr
- the line number in the XML data where the exception occurred.elementName
- the name of the offending elementattributeName
- the name of the offending attributeattributeValue
- the value of the offending attributemsg
- the message of the exception.
-
-
Method Details
-
finalize
Cleans up the object when it's destroyed.- Overrides:
finalize
in classXMLException
- Throws:
Throwable
-
getElementName
Returns the name of the element in which the validation is violated. If there is no current element, null is returned. -
getAttributeName
Returns the name of the attribute in which the validation is violated. If there is no current attribute, null is returned. -
getAttributeValue
Returns the value of the attribute in which the validation is violated. If there is no current attribute, null is returned.
-