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:
java.io.Serializable
public class XMLValidationException extends XMLException
An XMLValidationException is thrown when the XML passed to the XML parser is well-formed but not valid.- Author:
- Marc De Scheemaecker
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static intATTRIBUTE_WITH_INVALID_VALUEAn attribute has an invalid value.static intMISC_ERRORAnother error than those specified in this class was encountered.static intMISSING_ATTRIBUTEAn attribute was missing.static intMISSING_ELEMENTAn element was missing.static intMISSING_PCDATAA PCDATA element was missing.static intUNEXPECTED_ATTRIBUTEAn unexpected attribute was encountered.static intUNEXPECTED_ELEMENTAn unexpected element was encountered.static intUNEXPECTED_PCDATAAn unexpected PCDATA element was encountered.
-
Constructor Summary
Constructors Constructor Description XMLValidationException(int errorType, java.lang.String systemID, int lineNr, java.lang.String elementName, java.lang.String attributeName, java.lang.String attributeValue, java.lang.String msg)Creates a new exception.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidfinalize()Cleans up the object when it's destroyed.java.lang.StringgetAttributeName()Returns the name of the attribute in which the validation is violated.java.lang.StringgetAttributeValue()Returns the value of the attribute in which the validation is violated.java.lang.StringgetElementName()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
-
-
-
-
Field Detail
-
MISSING_ELEMENT
public static final int MISSING_ELEMENT
An element was missing.- See Also:
- Constant Field Values
-
UNEXPECTED_ELEMENT
public static final int UNEXPECTED_ELEMENT
An unexpected element was encountered.- See Also:
- Constant Field Values
-
MISSING_ATTRIBUTE
public static final int MISSING_ATTRIBUTE
An attribute was missing.- See Also:
- Constant Field Values
-
UNEXPECTED_ATTRIBUTE
public static final int UNEXPECTED_ATTRIBUTE
An unexpected attribute was encountered.- See Also:
- Constant Field Values
-
ATTRIBUTE_WITH_INVALID_VALUE
public static final int ATTRIBUTE_WITH_INVALID_VALUE
An attribute has an invalid value.- See Also:
- Constant Field Values
-
MISSING_PCDATA
public static final int MISSING_PCDATA
A PCDATA element was missing.- See Also:
- Constant Field Values
-
UNEXPECTED_PCDATA
public static final int UNEXPECTED_PCDATA
An unexpected PCDATA element was encountered.- See Also:
- Constant Field Values
-
MISC_ERROR
public static final int MISC_ERROR
Another error than those specified in this class was encountered.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
XMLValidationException
public XMLValidationException(int errorType, java.lang.String systemID, int lineNr, java.lang.String elementName, java.lang.String attributeName, java.lang.String attributeValue, java.lang.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 Detail
-
finalize
protected void finalize() throws java.lang.ThrowableCleans up the object when it's destroyed.- Overrides:
finalizein classXMLException- Throws:
java.lang.Throwable
-
getElementName
public java.lang.String getElementName()
Returns the name of the element in which the validation is violated. If there is no current element, null is returned.
-
getAttributeName
public java.lang.String getAttributeName()
Returns the name of the attribute in which the validation is violated. If there is no current attribute, null is returned.
-
getAttributeValue
public java.lang.String getAttributeValue()
Returns the value of the attribute in which the validation is violated. If there is no current attribute, null is returned.
-
-