public class ValidationException extends XPathException implements SourceLocator, Locator
XPathException.Circularity
Constructor and Description |
---|
ValidationException(Exception exception)
Creates a new ValidationException with the given nested
exception.
|
ValidationException(String message)
Creates a new ValidationException with the given message.
|
ValidationException(String message,
Exception exception)
Creates a new ValidationException with the given message
and nested exception.
|
ValidationException(String message,
SourceLocator locator)
Create a new ValidationException from a message and a Locator.
|
Modifier and Type | Method and Description |
---|---|
AbsolutePath |
getAbsolutePath()
Get the location of the error as a structured path object
|
int |
getColumnNumber() |
String |
getConstraintClauseNumber()
Get the constraint clause number
|
String |
getConstraintName()
Get the constraint name
|
String |
getConstraintReference()
Get the constraint name and clause in the format defined in XML Schema Part C (Outcome Tabulations).
|
String |
getConstraintReferenceMessage()
Get the constraint reference as a string for inserting into an error message.
|
int |
getConstraintSchemaPart()
Get the "schema part" component of the constraint reference
|
String |
getContextLocationText()
Get additional location text, if any.
|
AbsolutePath |
getContextPath() |
int |
getLineNumber() |
SourceLocator |
getLocator() |
NodeInfo |
getNode() |
String |
getPath()
Get the location of the error in terms of a path expressed as a string
|
String |
getPublicId() |
SchemaType |
getSchemaType()
Get the schema type against which validation was attempted and failed
|
String |
getSystemId() |
String |
getValidationLocationText()
Get additional location text, if any.
|
void |
setColumnNumber(int column) |
void |
setConstraintReference(int schemaPart,
String constraintName,
String clause)
Set a reference to the constraint in XML Schema that is not satisfied
|
void |
setConstraintReference(ValidationException e)
Copy the constraint reference from another exception object
|
void |
setContextPath(AbsolutePath path) |
void |
setLineNumber(int line) |
void |
setLocator(Locator locator) |
void |
setNode(NodeInfo node) |
void |
setPath(AbsolutePath path)
Set the path in the source document
|
void |
setPublicId(String id) |
void |
setSchemaType(SchemaType type)
Set the schema type against which validation was attempted and failed
|
void |
setSourceLocator(SourceLocator locator) |
void |
setSystemId(String id) |
String |
toString()
Returns the String representation of this Exception
|
getAdditionalLocationText, getErrorCodeLocalPart, getErrorCodeNamespace, getErrorCodeQName, getErrorObject, getXPathContext, hasBeenReported, isGlobalError, isReportableStatically, isStaticError, isTypeError, makeXPathException, maybeSetContext, maybeSetErrorCode, maybeSetLocation, setAdditionalLocationText, setErrorCode, setErrorCodeQName, setErrorObject, setHasBeenReported, setIsGlobalError, setIsStaticError, setIsTypeError, setXPathContext
getCause, getException, getLocationAsString, getMessageAndLocation, initCause, printStackTrace, printStackTrace, printStackTrace, setLocator
addSuppressed, fillInStackTrace, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, setStackTrace
public ValidationException(String message)
message
- the message for this Exceptionpublic ValidationException(Exception exception)
exception
- the nested exceptionpublic ValidationException(String message, Exception exception)
message
- the detail message for this exceptionexception
- the nested exceptionpublic ValidationException(String message, SourceLocator locator)
message
- The error or warning message.locator
- The locator object for the error or warning.public void setConstraintReference(int schemaPart, String constraintName, String clause)
schemaPart
- - 1 or 2, depending whether the constraint is in XMLSchema part 1 or part 2constraintName
- - the short name of the constraint in XMLSchema, as a fragment identifier in the
HTML of the XML Schema Part 1 specificationclause
- - the clause number within the description of that constraintpublic void setConstraintReference(ValidationException e)
e
- the other exception object from which to copy the informationpublic String getConstraintReferenceMessage()
public int getConstraintSchemaPart()
public String getConstraintName()
public String getConstraintClauseNumber()
public String getConstraintReference()
public void setPath(AbsolutePath path)
path
- the path to the invalid element in the source documentpublic String toString()
public String getPublicId()
getPublicId
in interface SourceLocator
getPublicId
in interface Locator
public String getSystemId()
getSystemId
in interface SourceLocator
getSystemId
in interface Locator
public int getLineNumber()
getLineNumber
in interface SourceLocator
getLineNumber
in interface Locator
public int getColumnNumber()
getColumnNumber
in interface SourceLocator
getColumnNumber
in interface Locator
public NodeInfo getNode()
public String getPath()
public AbsolutePath getAbsolutePath()
public void setPublicId(String id)
public void setSystemId(String id)
public void setLineNumber(int line)
public void setColumnNumber(int column)
public void setLocator(Locator locator)
public void setSourceLocator(SourceLocator locator)
public void setNode(NodeInfo node)
public SourceLocator getLocator()
getLocator
in class TransformerException
public void setContextPath(AbsolutePath path)
public AbsolutePath getContextPath()
public String getValidationLocationText()
public String getContextLocationText()
public SchemaType getSchemaType()
public void setSchemaType(SchemaType type)
type
- the relevant schema type if available, or null otherwiseCopyright (c) 2004-2014 Saxonica Limited. All rights reserved.