Class JiBXParseException

  • All Implemented Interfaces:
    Serializable
    Direct Known Subclasses:
    JiBXConstrainedParseException

    public class JiBXParseException
    extends JiBXException
    JiBX parsing exception class. This subclass of JiBXException provides additional details when a parsing error occurs such as what tag was being parsed and what value caused the error.
    Author:
    Joshua Davies
    See Also:
    Serialized Form
    • Constructor Detail

      • JiBXParseException

        public JiBXParseException​(String msg,
                                  String value)
        Constructor from message.
        Parameters:
        msg - the throwers description of what's gone wrong.
        value - the value which was unparseable (in string format).
      • JiBXParseException

        public JiBXParseException​(String msg,
                                  String value,
                                  Throwable root)
        Constructor from message and wrapped exception.
        Parameters:
        msg - the throwers description of what's gone wrong.
        value - the value which was unparseable (in string format).
        root - exception which caused this exception
      • JiBXParseException

        public JiBXParseException​(String msg,
                                  String value,
                                  String namespace,
                                  String tagName,
                                  Throwable root)
        Constructor from message, wrapped exception and tag name.
        Parameters:
        msg - message describing the exception condition
        value - the value which was unparseable (in string format).
        namespace - the namespace (if any) associated with the tag.
        tagName - the name of the tag whose element caused the exception.
        root - exception which caused this exception
    • Method Detail

      • setNamespace

        public void setNamespace​(String namespace)
        Add namespace detail to the exception.
        Parameters:
        namespace - the namespace of the offending tag.
      • setTagName

        public void setTagName​(String tagName)
        Add tag name detail to the exception.
        Parameters:
        tagName - the name of the offending tag.
      • getMessage

        public String getMessage()
        Append useful parsing details onto the default message.
        Overrides:
        getMessage in class Throwable
        Returns:
        the parent's message plus "caused by value" addendum.
      • equals

        public boolean equals​(Object obj)
        This is only used for testing purposes.
        Overrides:
        equals in class Object
        Parameters:
        obj - what to compare against.
        Returns:
        true or false