Class TLcdXMLUnmarshallerAdapter<T>
java.lang.Object
com.luciad.format.xml.bind.schema.TLcdXMLUnmarshallerAdapter<T>
- Type Parameters:
T
- The Java class handled by theILcdXMLTypeUnmarshaller
to be wrapped.
- All Implemented Interfaces:
ILcdXMLUnmarshaller<T>
A wrapper class for
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.- Since:
- 9.0
-
Constructor Summary
ConstructorDescriptionTLcdXMLUnmarshallerAdapter
(ILcdXMLTypeUnmarshaller<T> aTypeUnmarshaller, TLcdXMLSchemaElement aSchemaElement, TLcdXMLSchemaTypeIdentifier aSchemaTypeIdentifier, Class<T> aClass, TLcdXMLSchemaBasedDecoder aDecoder) Creates a newTLcdXMLUnmarshallerAdapter
for the specifiedILcdXMLTypeUnmarshaller
.TLcdXMLUnmarshallerAdapter
(ILcdXMLTypeUnmarshaller<T> aTypeUnmarshaller, TLcdXMLSchemaElement aSchemaElement, Class<T> aClass, TLcdXMLSchemaBasedDecoder aDecoder) Creates a newTLcdXMLUnmarshallerAdapter
for the specifiedILcdXMLTypeUnmarshaller
. -
Method Summary
Modifier and TypeMethodDescriptiontoString()
unmarshal
(XMLStreamReader aReader, ILcdXMLDocumentContext aContext) Unmarshals (deserializes) the XML element at the current cursor position of the specifiedXMLStreamReader
and returns the resulting Java object graph.
-
Constructor Details
-
TLcdXMLUnmarshallerAdapter
public TLcdXMLUnmarshallerAdapter(ILcdXMLTypeUnmarshaller<T> aTypeUnmarshaller, TLcdXMLSchemaElement aSchemaElement, Class<T> aClass, TLcdXMLSchemaBasedDecoder aDecoder) Creates a newTLcdXMLUnmarshallerAdapter
for the specifiedILcdXMLTypeUnmarshaller
.- Parameters:
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.
-
TLcdXMLUnmarshallerAdapter
public TLcdXMLUnmarshallerAdapter(ILcdXMLTypeUnmarshaller<T> aTypeUnmarshaller, TLcdXMLSchemaElement aSchemaElement, TLcdXMLSchemaTypeIdentifier aSchemaTypeIdentifier, Class<T> aClass, TLcdXMLSchemaBasedDecoder aDecoder) Creates a newTLcdXMLUnmarshallerAdapter
for the specifiedILcdXMLTypeUnmarshaller
.- Parameters:
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.
-
-
Method Details
-
toString
-
unmarshal
public T unmarshal(XMLStreamReader aReader, ILcdXMLDocumentContext aContext) throws XMLStreamException Description copied from interface:ILcdXMLUnmarshaller
Unmarshals (deserializes) the XML element at the current cursor position of the specifiedXMLStreamReader
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.- Specified by:
unmarshal
in interfaceILcdXMLUnmarshaller<T>
- Parameters:
aReader
- the StAX reader to unmarshal XML data from.aContext
- aILcdXMLDocumentContext
which can be used to store and retrieve information which is shared between multiple unmarshallers. This context is unique per unmarshalled XML document.- Returns:
- the newly created Java object graph representing the XML element that was unmarshalled.
- Throws:
XMLStreamException
- if any unexpected content occurs within the XML element to be unmarshalled.
-