Class ValidationException

All Implemented Interfaces:
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:
  • Constructor Details

    • ValidationException

      public ValidationException(Exception exception)
      Creates a new ValidationException with the given nested exception.
      Parameters:
      exception - the nested exception
    • ValidationException

      public ValidationException(String message, 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(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 Details

    • getMessage

      public String getMessage()
      Returns the detail message string of this throwable.
      Overrides:
      getMessage in class Throwable
      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 String toString()
      Returns the String representation of this Exception
      Overrides:
      toString in class Throwable
      Returns:
      the String representation of this Exception
    • getNode

      public NodeInfo getNode()
    • getPath

      public 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