Class JiBXParseException

  • All Implemented Interfaces:
    java.io.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
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.lang.String m_namespace  
      private java.lang.String m_tagName  
      private java.lang.String m_value  
    • Constructor Summary

      Constructors 
      Constructor Description
      JiBXParseException​(java.lang.String msg, java.lang.String value)
      Constructor from message.
      JiBXParseException​(java.lang.String msg, java.lang.String value, java.lang.String namespace, java.lang.String tagName, java.lang.Throwable root)
      Constructor from message, wrapped exception and tag name.
      JiBXParseException​(java.lang.String msg, java.lang.String value, java.lang.Throwable root)
      Constructor from message and wrapped exception.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object obj)
      This is only used for testing purposes.
      java.lang.String getMessage()
      Append useful parsing details onto the default message.
      void setNamespace​(java.lang.String namespace)
      Add namespace detail to the exception.
      void setTagName​(java.lang.String tagName)
      Add tag name detail to the exception.
      • Methods inherited from class java.lang.Throwable

        addSuppressed, fillInStackTrace, getLocalizedMessage, getStackTrace, getSuppressed, initCause, setStackTrace, toString
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • m_value

        private java.lang.String m_value
      • m_namespace

        private java.lang.String m_namespace
      • m_tagName

        private java.lang.String m_tagName
    • Constructor Detail

      • JiBXParseException

        public JiBXParseException​(java.lang.String msg,
                                  java.lang.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​(java.lang.String msg,
                                  java.lang.String value,
                                  java.lang.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​(java.lang.String msg,
                                  java.lang.String value,
                                  java.lang.String namespace,
                                  java.lang.String tagName,
                                  java.lang.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​(java.lang.String namespace)
        Add namespace detail to the exception.
        Parameters:
        namespace - the namespace of the offending tag.
      • setTagName

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

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

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