Package org.codehaus.stax2.typed
Class TypedXMLStreamException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- javax.xml.stream.XMLStreamException
-
- org.codehaus.stax2.typed.TypedXMLStreamException
-
- All Implemented Interfaces:
Serializable
public class TypedXMLStreamException extends XMLStreamException
This class represents an exception throw by anTypedXMLStreamReader
or anTypedXMLStreamWriter
. 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 (
XMLStreamException
s 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 typeIllegalArgumentException
, 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 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(String lexical, IllegalArgumentException rootCause)
Constructor used to wrap an underlying data conversion error message.TypedXMLStreamException(String lexical, String msg)
Construct an exception with the associated message.TypedXMLStreamException(String lexical, String msg, IllegalArgumentException rootCause)
Construct an exception with the associated message and exceptionTypedXMLStreamException(String lexical, String msg, Location location)
Construct an exception with the associated message, exception and location.TypedXMLStreamException(String lexical, String msg, Location location, 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 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
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
-
-
-
Field Detail
-
mLexical
protected String mLexical
Lexical representation of the content that could not be converted to the requested type. May benull
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(String lexical, String msg)
Construct an exception with the associated message.- Parameters:
msg
- The message to report.
-
TypedXMLStreamException
public TypedXMLStreamException(String lexical, IllegalArgumentException rootCause)
Constructor used to wrap an underlying data conversion error message.- Parameters:
rootCause
- Underlying conversion problem
-
TypedXMLStreamException
public TypedXMLStreamException(String lexical, String msg, IllegalArgumentException rootCause)
Construct an exception with the associated message and exception- Parameters:
msg
- The message to report.rootCause
- Underlying conversion problem
-
TypedXMLStreamException
public TypedXMLStreamException(String lexical, String msg, Location location, 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
-
-
Method Detail
-
getLexical
public 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.
-
-