Class TypedXMLStreamException

  • All Implemented Interfaces:
    java.io.Serializable

    public class TypedXMLStreamException
    extends javax.xml.stream.XMLStreamException
    This class represents an exception throw by an TypedXMLStreamReader or an TypedXMLStreamWriter. It is used to indicate a problems occuring when trying convert data for access using typed read or write methods.

    Note that the lexical value is a mandatory thing to pass -- since this exception subtype need not be used solely for wrapping purposes (XMLStreamExceptions are to be passed as is, other underlying root cause types should be unchecked), we can mandate a lexical value (which may be null, however) to be passed. Similarly, aside from generic stream exception, it is mandated that root causes to wrap need to be of type IllegalArgumentException, since that is the supertype of regular parsing/conversion types for primitive types.

    Since:
    3.0
    Author:
    Santiago.PericasGeertsen@sun.com, Tatu Saloranta
    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected java.lang.String mLexical
      Lexical representation of the content that could not be converted to the requested type.
      • Fields inherited from class javax.xml.stream.XMLStreamException

        location, nested
    • Constructor Summary

      Constructors 
      Constructor Description
      TypedXMLStreamException​(java.lang.String lexical, java.lang.IllegalArgumentException rootCause)
      Constructor used to wrap an underlying data conversion error message.
      TypedXMLStreamException​(java.lang.String lexical, java.lang.String msg)
      Construct an exception with the associated message.
      TypedXMLStreamException​(java.lang.String lexical, java.lang.String msg, java.lang.IllegalArgumentException rootCause)
      Construct an exception with the associated message and exception
      TypedXMLStreamException​(java.lang.String lexical, java.lang.String msg, javax.xml.stream.Location location)
      Construct an exception with the associated message, exception and location.
      TypedXMLStreamException​(java.lang.String lexical, java.lang.String msg, javax.xml.stream.Location location, java.lang.IllegalArgumentException rootCause)
      Construct an exception with the associated message, exception and location.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String getLexical()
      Return the lexical representation of the attribute or element content that could not be converted as requested.
      • Methods inherited from class javax.xml.stream.XMLStreamException

        getLocation, getNestedException
      • Methods inherited from class java.lang.Throwable

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

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

      • mLexical

        protected java.lang.String mLexical
        Lexical representation of the content that could not be converted to the requested type. May be null if a processor is unable to provide it. Lexical representation should preferably be as close to the original input String as possible (as opposed to being normalized which often is done before actual parsing).
    • Constructor Detail

      • TypedXMLStreamException

        public TypedXMLStreamException​(java.lang.String lexical,
                                       java.lang.String msg)
        Construct an exception with the associated message.
        Parameters:
        msg - The message to report.
      • TypedXMLStreamException

        public TypedXMLStreamException​(java.lang.String lexical,
                                       java.lang.IllegalArgumentException rootCause)
        Constructor used to wrap an underlying data conversion error message.
        Parameters:
        rootCause - Underlying conversion problem
      • TypedXMLStreamException

        public TypedXMLStreamException​(java.lang.String lexical,
                                       java.lang.String msg,
                                       java.lang.IllegalArgumentException rootCause)
        Construct an exception with the associated message and exception
        Parameters:
        msg - The message to report.
        rootCause - Underlying conversion problem
      • TypedXMLStreamException

        public TypedXMLStreamException​(java.lang.String lexical,
                                       java.lang.String msg,
                                       javax.xml.stream.Location location,
                                       java.lang.IllegalArgumentException rootCause)
        Construct an exception with the associated message, exception and location.
        Parameters:
        msg - The message to report.
        location - The location of the error.
        rootCause - Underlying conversion problem
      • TypedXMLStreamException

        public TypedXMLStreamException​(java.lang.String lexical,
                                       java.lang.String msg,
                                       javax.xml.stream.Location location)
        Construct an exception with the associated message, exception and location.
        Parameters:
        msg - The message to report.
        location - The location of the error.
    • Method Detail

      • getLexical

        public java.lang.String getLexical()
        Return the lexical representation of the attribute or element content that could not be converted as requested.
        Returns:
        Lexical representation of unconverted content or null if unavailable.