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:
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 net.sf.saxon.trans.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 net.sf.saxon.trans.XPathException
asStaticError, asTypeError, asTypeErrorIf, fromXmlProcessingError, getErrorCodeQName, getErrorObject, getFailingExpression, getHostLanguage, getLocator, getXPathContext, hasBeenReported, hasErrorCode, isGlobalError, isReportableStatically, isStaticError, isSyntaxError, isTypeError, makeXPathException, maybeSetContext, maybeSetErrorCode, maybeSetLocation, maybeWithContext, maybeWithErrorCode, maybeWithFailingExpression, maybeWithLocation, replacingErrorCode, setErrorCode, setErrorCodeQName, setErrorObject, setHasBeenReported, setHostLanguage, setHostLanguage, setIsGlobalError, setIsStaticError, setIsSyntaxError, setIsTypeError, setLocation, setXPathContext, showErrorCode, withErrorCode, withErrorCode, withFailingExpression, withLocation, withMessage, withXPathContext
Methods inherited from class javax.xml.transform.TransformerException
getCause, getException, getLocationAsString, getMessageAndLocation, initCause, printStackTrace, printStackTrace, printStackTrace, setLocator
Methods inherited from class java.lang.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
Creates a new ValidationException with the given message and nested exception.- Parameters:
message
- the detail message for this exceptionexception
- the nested exception
-
ValidationException
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
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:
getMessage
in classThrowable
- Returns:
- the detail message string of this
Throwable
instance (which may benull
).
-
getValidationFailure
Get a ValidationFailure object containing information from this ValidationException- Returns:
- a ValidationFailure object
-
toString
Returns the String representation of this Exception -
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
-