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:
Serializable
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:
-
Nested Class Summary
Nested classes/interfaces inherited from class XPathException
XPathException.Circularity, XPathException.StackOverflow -
Constructor Summary
ConstructorsConstructorDescriptionValidationException(Exception exception) Creates a new ValidationException with the given nested exception.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.ValidationException(ValidationFailure failure) Create a new ValidationException that wraps a ValidationFailure -
Method Summary
Modifier and TypeMethodDescriptionGet the location of the error as a structured path objectReturns the detail message string of this throwable.getNode()getPath()Get the location of the error in terms of a path expressed as a stringGet a ValidationFailure object containing information from this ValidationExceptiontoString()Returns the String representation of this ExceptionMethods inherited from class 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, withErrorCodeMethods inherited from class TransformerException
getCause, getException, getLocationAsString, getMessageAndLocation, initCause, printStackTrace, printStackTrace, printStackTrace, setLocatorMethods inherited from class Throwable
addSuppressed, fillInStackTrace, getLocalizedMessage, getStackTrace, getSuppressed, setStackTrace
-
Constructor Details
-
ValidationException
Creates a new ValidationException with the given nested exception.- Parameters:
exception- the nested exception
-
ValidationException
-
ValidationException
-
ValidationException
Create a new ValidationException that wraps a ValidationFailure- Parameters:
failure- the ValidationFailure to be wrapped
-
-
Method Details
-
getMessage
Returns the detail message string of this throwable.- Overrides:
getMessagein classThrowable- Returns:
- the detail message string of this
Throwableinstance (which may benull).
-
getValidationFailure
Get a ValidationFailure object containing information from this ValidationException- Returns:
- a ValidationFailure object
-
toString
-
getNode
-
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
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
-