Class 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
    • 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 exception
        exception - 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 class XPathException
        Returns:
        the detail message string of this Throwable instance (which may be null).
      • 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 class java.lang.Throwable
        Returns:
        the String representation of this Exception
      • 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