public class XMLValidationException extends XMLException
Modifier and Type | Field and Description |
---|---|
static int |
ATTRIBUTE_WITH_INVALID_VALUE
An attribute has an invalid value.
|
static int |
MISC_ERROR
Another error than those specified in this class was encountered.
|
static int |
MISSING_ATTRIBUTE
An attribute was missing.
|
static int |
MISSING_ELEMENT
An element was missing.
|
static int |
MISSING_PCDATA
A PCDATA element was missing.
|
static int |
UNEXPECTED_ATTRIBUTE
An unexpected attribute was encountered.
|
static int |
UNEXPECTED_ELEMENT
An unexpected element was encountered.
|
static int |
UNEXPECTED_PCDATA
An unexpected PCDATA element was encountered.
|
Constructor and 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.
|
Modifier and Type | Method and Description |
---|---|
protected void |
finalize()
Cleans up the object when it's destroyed.
|
java.lang.String |
getAttributeName()
Returns the name of the attribute in which the validation is violated.
|
java.lang.String |
getAttributeValue()
Returns the value of the attribute in which the validation is violated.
|
java.lang.String |
getElementName()
Returns the name of the element in which the validation is violated.
|
getException, getLineNr, getSystemID, printStackTrace, printStackTrace, printStackTrace, toString
public static final int MISSING_ELEMENT
public static final int UNEXPECTED_ELEMENT
public static final int MISSING_ATTRIBUTE
public static final int UNEXPECTED_ATTRIBUTE
public static final int ATTRIBUTE_WITH_INVALID_VALUE
public static final int MISSING_PCDATA
public static final int UNEXPECTED_PCDATA
public static final int MISC_ERROR
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)
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.protected void finalize() throws java.lang.Throwable
finalize
in class XMLException
java.lang.Throwable
public java.lang.String getElementName()
public java.lang.String getAttributeName()
public java.lang.String getAttributeValue()