net.n3.nanoxml

Class XMLValidationException

public class XMLValidationException extends XMLException

An XMLValidationException is thrown when the XML passed to the XML parser is well-formed but not valid.

Version: $Name: RELEASE_2_2_1 $, $Revision: 1.3 $

Author: Marc De Scheemaecker

Field Summary
static intATTRIBUTE_WITH_INVALID_VALUE
An attribute has an invalid value.
static intMISC_ERROR
Another error than those specified in this class was encountered.
static intMISSING_ATTRIBUTE
An attribute was missing.
static intMISSING_ELEMENT
An element was missing.
static intMISSING_PCDATA
A PCDATA element was missing.
static intUNEXPECTED_ATTRIBUTE
An unexpected attribute was encountered.
static intUNEXPECTED_ELEMENT
An unexpected element was encountered.
static intUNEXPECTED_PCDATA
An unexpected PCDATA element was encountered.
Constructor Summary
XMLValidationException(int errorType, String systemID, int lineNr, String elementName, String attributeName, String attributeValue, String msg)
Creates a new exception.
Method Summary
protected voidfinalize()
Cleans up the object when it's destroyed.
StringgetAttributeName()
Returns the name of the attribute in which the validation is violated.
StringgetAttributeValue()
Returns the value of the attribute in which the validation is violated.
StringgetElementName()
Returns the name of the element in which the validation is violated.

Field Detail

ATTRIBUTE_WITH_INVALID_VALUE

public static final int ATTRIBUTE_WITH_INVALID_VALUE
An attribute has an invalid value.

MISC_ERROR

public static final int MISC_ERROR
Another error than those specified in this class was encountered.

MISSING_ATTRIBUTE

public static final int MISSING_ATTRIBUTE
An attribute was missing.

MISSING_ELEMENT

public static final int MISSING_ELEMENT
An element was missing.

MISSING_PCDATA

public static final int MISSING_PCDATA
A PCDATA element was missing.

UNEXPECTED_ATTRIBUTE

public static final int UNEXPECTED_ATTRIBUTE
An unexpected attribute was encountered.

UNEXPECTED_ELEMENT

public static final int UNEXPECTED_ELEMENT
An unexpected element was encountered.

UNEXPECTED_PCDATA

public static final int UNEXPECTED_PCDATA
An unexpected PCDATA element was encountered.

Constructor Detail

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 error systemID the system ID from where the data came lineNr the line number in the XML data where the exception occurred. elementName the name of the offending element attributeName the name of the offending attribute attributeValue the value of the offending attribute msg the message of the exception.

Method Detail

finalize

protected void finalize()
Cleans up the object when it's destroyed.

getAttributeName

public 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 String getAttributeValue()
Returns the value of the attribute in which the validation is violated. If there is no current attribute, null is returned.

getElementName

public String getElementName()
Returns the name of the element in which the validation is violated. If there is no current element, null is returned.