public class ValidationException extends XPathException implements Location
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,
Location 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()
Get the column number.
|
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()
Get the line number.
|
Location |
getLocator()
Method getLocator retrieves an instance of a SourceLocator
object that specifies where an error occured.
|
NodeInfo |
getNode() |
String |
getPath()
Get the location of the error in terms of a path expressed as a string
|
String |
getPublicId()
Get the Public ID
|
SchemaType |
getSchemaType()
Get the schema type against which validation was attempted and failed
|
String |
getSystemId()
Get the system ID.
|
String |
getValidationLocationText()
Get additional location text, if any.
|
Location |
saveLocation()
Get an immutable copy of this Location object.
|
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 |
setLocation(Location 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 |
setSystemId(String id) |
String |
toString()
Returns the String representation of this Exception
|
getAdditionalLocationText, getErrorCodeLocalPart, getErrorCodeNamespace, getErrorCodeQName, getErrorObject, getHostLanguage, getXPathContext, hasBeenReported, isGlobalError, isReportableStatically, isStaticError, isSyntaxError, isTypeError, makeXPathException, maybeSetContext, maybeSetErrorCode, maybeSetLocation, setAdditionalLocationText, setErrorCode, setErrorCodeQName, setErrorObject, setHasBeenReported, setHostLanguage, setIsGlobalError, setIsStaticError, setIsSyntaxError, setIsTypeError, setXPathContextgetCause, getException, getLocationAsString, getMessageAndLocation, initCause, printStackTrace, printStackTrace, printStackTrace, setLocatoraddSuppressed, fillInStackTrace, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, setStackTracepublic 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 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()
LocationgetPublicId in interface SourceLocatorgetPublicId in interface LocationgetPublicId in interface Locatorpublic String getSystemId()
LocationThe system identifier of a node is in general not the same as its base URI. The base URI is affected by xml:base attributes; the system identifier is not.
getSystemId in interface SourceLocatorgetSystemId in interface LocationgetSystemId in interface Locatorpublic int getLineNumber()
LocationgetLineNumber in interface SourceLocatorgetLineNumber in interface LocationgetLineNumber in interface Locatorpublic int getColumnNumber()
LocationgetColumnNumber in interface SourceLocatorgetColumnNumber in interface LocationgetColumnNumber in interface Locatorpublic Location saveLocation()
saveLocation in interface Locationpublic 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 setLocation(Location locator)
setLocation in class XPathExceptionpublic void setNode(NodeInfo node)
public Location getLocator()
XPathExceptiongetLocator in class XPathExceptionpublic 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.