Class TLcdXMLUnmarshallerAdapter<T>

java.lang.Object
com.luciad.format.xml.bind.schema.TLcdXMLUnmarshallerAdapter<T>
Type Parameters:
T - The Java class handled by the ILcdXMLTypeUnmarshaller to be wrapped.
All Implemented Interfaces:
ILcdXMLUnmarshaller<T>

public class TLcdXMLUnmarshallerAdapter<T> extends Object implements 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 Details

    • TLcdXMLUnmarshallerAdapter

      public TLcdXMLUnmarshallerAdapter(ILcdXMLTypeUnmarshaller<T> aTypeUnmarshaller, TLcdXMLSchemaElement aSchemaElement, Class<T> aClass, TLcdXMLSchemaBasedDecoder aDecoder)
      Creates a new TLcdXMLUnmarshallerAdapter for the specified ILcdXMLTypeUnmarshaller.
      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 new TLcdXMLUnmarshallerAdapter for the specified ILcdXMLTypeUnmarshaller.
      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 factory
      aClass - the Java class to which the specified type unmarshaller will unmarshal.
      aDecoder - the decoder onto which this adapter will be registered.
  • Method Details

    • toString

      public String toString()
      Overrides:
      toString in class Object
    • 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 specified 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.

      Specified by:
      unmarshal in interface ILcdXMLUnmarshaller<T>
      Parameters:
      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.
      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.