Class ValidationException

  • All Implemented Interfaces:
    Serializable

    public class ValidationException
    extends RecoverableException
    Validation exception class. This is used for marshalling and unmarshalling errors that relate to data content.
    Version:
    1.0
    Author:
    Dennis M. Sosnoski
    See Also:
    Serialized Form
    • Constructor Detail

      • ValidationException

        public ValidationException​(String msg)
        Constructor from message.
        Parameters:
        msg - message describing the exception condition
      • ValidationException

        public ValidationException​(String msg,
                                   Throwable root)
        Constructor from message and wrapped exception.
        Parameters:
        msg - message describing the exception condition
        root - exception which caused this exception
      • ValidationException

        public ValidationException​(String msg,
                                   Object obj)
        Constructor from message and validation object.
        Parameters:
        msg - message describing the exception condition
        obj - source object for validation error
      • ValidationException

        public ValidationException​(String msg,
                                   Throwable root,
                                   Object obj)
        Constructor from message, wrapped exception, and validation object.
        Parameters:
        msg - message describing the exception condition
        root - exception which caused this exception
        obj - source object for validation error
      • ValidationException

        public ValidationException​(String msg,
                                   Object obj,
                                   IUnmarshallingContext ctx)
        Constructor from message, validation object, and unmarshalling context.
        Parameters:
        msg - message describing the exception condition
        obj - source object for validation error
        ctx - context used for unmarshalling
    • Method Detail

      • describe

        public static String describe​(Object obj)
        Get description information for a validation object. For an unmarshalled object with source references available this returns the source position description. Otherwise, it returns the result of a Object.toString() method call.
        Parameters:
        obj - source object for validation error
        Returns:
        object description text
      • addDescription

        public static String addDescription​(String msg,
                                            Object obj)
        Add description information for a validation object to message. This just appends the result of a describe(java.lang.Object) call to the supplied message, with some appropriate formatting.
        Parameters:
        msg - base message text
        obj - source object for validation error
        Returns:
        message with object description appended
      • getMessage

        public String getMessage()
        Get exception description.
        Overrides:
        getMessage in class Throwable
        Returns:
        message describing the exception condition