Package net.sf.saxon.type
Class ValidationException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- javax.xml.transform.TransformerException
-
- net.sf.saxon.trans.XPathException
-
- net.sf.saxon.type.ValidationException
-
- All Implemented Interfaces:
java.io.Serializable
public class ValidationException extends XPathException
This exception indicates a failure when validating an instance against a type defined in a schema. It may also be used when validating against a built-in type.- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class net.sf.saxon.trans.XPathException
XPathException.Circularity, XPathException.StackOverflow
-
-
Constructor Summary
Constructors Constructor Description ValidationException(java.lang.Exception exception)
Creates a new ValidationException with the given nested exception.ValidationException(java.lang.String message, java.lang.Exception exception)
Creates a new ValidationException with the given message and nested exception.ValidationException(java.lang.String message, Location locator)
Create a new ValidationException from a message and a Locator.ValidationException(ValidationFailure failure)
Create a new ValidationException that wraps a ValidationFailure
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AbsolutePath
getAbsolutePath()
Get the location of the error as a structured path objectjava.lang.String
getMessage()
Returns the detail message string of this throwable.NodeInfo
getNode()
java.lang.String
getPath()
Get the location of the error in terms of a path expressed as a stringValidationFailure
getValidationFailure()
Get a ValidationFailure object containing information from this ValidationExceptionjava.lang.String
toString()
Returns the String representation of this Exception-
Methods inherited from class net.sf.saxon.trans.XPathException
fromXmlProcessingError, getErrorCodeLocalPart, getErrorCodeNamespace, getErrorCodeQName, getErrorObject, getFailingExpression, getHostLanguage, getLocator, getXPathContext, hasBeenReported, isGlobalError, isReportableStatically, isStaticError, isSyntaxError, isTypeError, makeXPathException, maybeSetContext, maybeSetErrorCode, maybeSetFailingExpression, maybeSetLocation, setErrorCode, setErrorCodeQName, setErrorObject, setFailingExpression, setHasBeenReported, setHostLanguage, setHostLanguage, setIsGlobalError, setIsStaticError, setIsSyntaxError, setIsTypeError, setLocation, setXPathContext
-
Methods inherited from class javax.xml.transform.TransformerException
getCause, getException, getLocationAsString, getMessageAndLocation, initCause, printStackTrace, printStackTrace, printStackTrace, setLocator
-
-
-
-
Constructor Detail
-
ValidationException
public ValidationException(java.lang.Exception exception)
Creates a new ValidationException with the given nested exception.- Parameters:
exception
- the nested exception
-
ValidationException
public ValidationException(java.lang.String message, java.lang.Exception exception)
Creates a new ValidationException with the given message and nested exception.- Parameters:
message
- the detail message for this exceptionexception
- the nested exception
-
ValidationException
public ValidationException(java.lang.String message, Location locator)
Create a new ValidationException from a message and a Locator.- Parameters:
message
- The error or warning message.locator
- The locator object for the error or warning.
-
ValidationException
public ValidationException(ValidationFailure failure)
Create a new ValidationException that wraps a ValidationFailure- Parameters:
failure
- the ValidationFailure to be wrapped
-
-
Method Detail
-
getMessage
public java.lang.String getMessage()
Returns the detail message string of this throwable.- Overrides:
getMessage
in classjava.lang.Throwable
- Returns:
- the detail message string of this
Throwable
instance (which may benull
).
-
getValidationFailure
public ValidationFailure getValidationFailure()
Get a ValidationFailure object containing information from this ValidationException- Returns:
- a ValidationFailure object
-
toString
public java.lang.String toString()
Returns the String representation of this Exception- Overrides:
toString
in classjava.lang.Throwable
- Returns:
- the String representation of this Exception
-
getNode
public NodeInfo getNode()
-
getPath
public java.lang.String getPath()
Get the location of the error in terms of a path expressed as a string- Returns:
- the location, as a path. The result format is similar to that of the fn:path() function
-
getAbsolutePath
public AbsolutePath getAbsolutePath()
Get the location of the error as a structured path object- Returns:
- the location, as a structured path object indicating the position of the error within the containing document
-
-