public class TypedXMLStreamException extends XMLStreamException
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 (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 type
IllegalArgumentException
, since that is the supertype
of regular parsing/conversion types for primitive types.
Modifier and Type | Field and Description |
---|---|
protected String |
mLexical
Lexical representation of the content that could not be
converted to the requested type.
|
location, nested
Constructor and 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 exception
|
TypedXMLStreamException(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.
|
Modifier and Type | Method and Description |
---|---|
String |
getLexical()
Return the lexical representation of the attribute or element
content that could not be converted as requested.
|
getLocation, getNestedException
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
protected String mLexical
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).public TypedXMLStreamException(String lexical, String msg)
msg
- The message to report.public TypedXMLStreamException(String lexical, IllegalArgumentException rootCause)
rootCause
- Underlying conversion problempublic TypedXMLStreamException(String lexical, String msg, IllegalArgumentException rootCause)
msg
- The message to report.rootCause
- Underlying conversion problempublic TypedXMLStreamException(String lexical, String msg, Location location, IllegalArgumentException rootCause)
msg
- The message to report.location
- The location of the error.rootCause
- Underlying conversion problempublic String getLexical()
null
if unavailable.Copyright © 2012-2015 fasterxml.com. All Rights Reserved.