Top Description Fields Constructors Methods
org.codehaus.stax2.typed

public Class TypedXMLStreamException

extends XMLStreamException
Class Inheritance
Imports
javax.xml.stream.Location, .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.

Authors
[email protected], Tatu Saloranta
Since
3.0

Field Summary

Modifier and TypeField and Description
protected String
mLexical

Lexical representation of the content that could not be converted to the requested type.

private static final long
Inherited from javax.xml.stream.XMLStreamException:
locationnested

Constructor Summary

AccessConstructor and Description
public
TypedXMLStreamException(String lexical, String
The message to report.
msg
)

Construct an exception with the associated message.

public
TypedXMLStreamException(String lexical, IllegalArgumentException
Underlying conversion problem
rootCause
)

Constructor used to wrap an underlying data conversion error message.

public
TypedXMLStreamException(String lexical, String
The message to report.
msg
,
IllegalArgumentException
Underlying conversion problem
rootCause
)

Construct an exception with the associated message and exception

public
TypedXMLStreamException(String lexical, String
The message to report.
msg
,
Location
The location of the error.
location
,
IllegalArgumentException
Underlying conversion problem
rootCause
)

Construct an exception with the associated message, exception and location.

public
TypedXMLStreamException(String lexical, String
The message to report.
msg
,
Location
The location of the error.
location
)

Construct an exception with the associated message, exception and location.

Method Summary

Modifier and TypeMethod and Description
public String

Returns:

Lexical representation of unconverted content or null if unavailable.
getLexical
()

Return the lexical representation of the attribute or element content that could not be converted as requested.

Inherited from javax.xml.stream.XMLStreamException:
getLocationgetNestedException

Field Detail

mLexicalback to summary
protected 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).

serialVersionUIDback to summary
private static final long serialVersionUID

Hides javax.xml.stream.XMLStreamException.serialVersionUID.

Constructor Detail

TypedXMLStreamExceptionback to summary
public TypedXMLStreamException(String lexical, String msg)

Construct an exception with the associated message.

Parameters
msg:String

The message to report.

TypedXMLStreamExceptionback to summary
public TypedXMLStreamException(String lexical, IllegalArgumentException rootCause)

Constructor used to wrap an underlying data conversion error message.

Parameters
rootCause:IllegalArgumentException

Underlying conversion problem

TypedXMLStreamExceptionback to summary
public TypedXMLStreamException(String lexical, String msg, IllegalArgumentException rootCause)

Construct an exception with the associated message and exception

Parameters
msg:String

The message to report.

rootCause:IllegalArgumentException

Underlying conversion problem

TypedXMLStreamExceptionback to summary
public TypedXMLStreamException(String lexical, String msg, Location location, IllegalArgumentException rootCause)

Construct an exception with the associated message, exception and location.

Parameters
msg:String

The message to report.

location:Location

The location of the error.

rootCause:IllegalArgumentException

Underlying conversion problem

TypedXMLStreamExceptionback to summary
public TypedXMLStreamException(String lexical, String msg, Location location)

Construct an exception with the associated message, exception and location.

Parameters
msg:String

The message to report.

location:Location

The location of the error.

Method Detail

getLexicalback to summary
public String getLexical()

Return the lexical representation of the attribute or element content that could not be converted as requested.

Returns:String

Lexical representation of unconverted content or null if unavailable.