T
- The Java class handled by the ILcdXMLTypeUnmarshaller
to be wrapped.public class TLcdXMLUnmarshallerAdapter<T> extends Object implements ILcdXMLUnmarshaller<T>
ILcdXMLTypeUnmarshaller
that converts it into an
ILcdXMLUnmarshaller
. The unmarshal()
method of this adapter will first search for
a suitable object factory in the decoder, create an object using this object factory, and then
delegate further unmarshalling to the wrapped type marshaller.Constructor and Description |
---|
TLcdXMLUnmarshallerAdapter(ILcdXMLTypeUnmarshaller<T> aTypeUnmarshaller,
TLcdXMLSchemaElement aSchemaElement,
Class<T> aClass,
TLcdXMLSchemaBasedDecoder aDecoder)
Creates a new
TLcdXMLUnmarshallerAdapter for the specified ILcdXMLTypeUnmarshaller . |
TLcdXMLUnmarshallerAdapter(ILcdXMLTypeUnmarshaller<T> aTypeUnmarshaller,
TLcdXMLSchemaElement aSchemaElement,
TLcdXMLSchemaTypeIdentifier aSchemaTypeIdentifier,
Class<T> aClass,
TLcdXMLSchemaBasedDecoder aDecoder)
Creates a new
TLcdXMLUnmarshallerAdapter for the specified ILcdXMLTypeUnmarshaller . |
Modifier and Type | Method and Description |
---|---|
String |
toString() |
T |
unmarshal(XMLStreamReader aReader,
ILcdXMLDocumentContext aContext)
Unmarshals (deserializes) the XML element at the current cursor position of the specified
XMLStreamReader
and returns the resulting Java object graph. |
public TLcdXMLUnmarshallerAdapter(ILcdXMLTypeUnmarshaller<T> aTypeUnmarshaller, TLcdXMLSchemaElement aSchemaElement, Class<T> aClass, TLcdXMLSchemaBasedDecoder aDecoder)
TLcdXMLUnmarshallerAdapter
for the specified ILcdXMLTypeUnmarshaller
.aTypeUnmarshaller
- the type unmarshaller to be wrapped.aSchemaElement
- the XML Schema element for which this adapter will be registered.aClass
- the Java class to which the specified type unmarshaller will unmarshal.aDecoder
- the decoder onto which this adapter will be registered.public TLcdXMLUnmarshallerAdapter(ILcdXMLTypeUnmarshaller<T> aTypeUnmarshaller, TLcdXMLSchemaElement aSchemaElement, TLcdXMLSchemaTypeIdentifier aSchemaTypeIdentifier, Class<T> aClass, TLcdXMLSchemaBasedDecoder aDecoder)
TLcdXMLUnmarshallerAdapter
for the specified ILcdXMLTypeUnmarshaller
.aTypeUnmarshaller
- the type unmarshaller to be wrapped.aSchemaElement
- the XML Schema element for which this adapter will be registered.aSchemaTypeIdentifier
- the schema identifier passed to the object factoryaClass
- the Java class to which the specified type unmarshaller will unmarshal.aDecoder
- the decoder onto which this adapter will be registered.public T unmarshal(XMLStreamReader aReader, ILcdXMLDocumentContext aContext) throws XMLStreamException
ILcdXMLUnmarshaller
XMLStreamReader
and returns the resulting Java object graph.
At the moment this method is called, the cursor should be positioned at the start tag of the element to be unmarshalled.
When this method returns, the cursor should be left at the end tag of the element which was unmarshalled.unmarshal
in interface ILcdXMLUnmarshaller<T>
aReader
- the StAX reader to unmarshal XML data from.aContext
- a ILcdXMLDocumentContext
which can be used to store and retrieve information which is shared
between multiple unmarshallers. This context is unique per unmarshalled XML document.XMLStreamException
- if any unexpected content occurs within the XML element to be unmarshalled.