Class TLcdXMLMarshallerAdapter<T>

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

public class TLcdXMLMarshallerAdapter<T> extends Object implements ILcdXMLMarshaller<T>
A wrapper class for ILcdXMLTypeMarshaller that converts it into an ILcdXMLMarshaller. The marshal() method of this adapter will first write the element's start tag, then delegate further marshalling to the wrapped type marshaller and finally write the element's end tag.
Since:
9.0
  • Constructor Details

    • TLcdXMLMarshallerAdapter

      public TLcdXMLMarshallerAdapter(QName aElementName, ILcdXMLTypeMarshaller<? super T> aTypeMarshaller)
      Creates a new TLcdXMLMarshallerAdapter wrapping the specified type marshaller.
      Parameters:
      aElementName - the XML element name to be written by this marshaller adapter.
      aTypeMarshaller - the type marshaller to be wrapped.
  • Method Details

    • marshal

      public void marshal(T aObject, XMLStreamWriter aWriter, ILcdXMLDocumentContext aContext) throws XMLStreamException
      Description copied from interface: ILcdXMLMarshaller
      Marshals (serializes) the specified Java object or content tree to an XML element via the specified XMLStreamWriter.

      This method should write a start tag for the object to be marshalled, followed by all the contents (attributes, simple content and child elements) of the object, and end with the corresponding end tag for the object.

      Specified by:
      marshal in interface ILcdXMLMarshaller<T>
      Parameters:
      aObject - the object to be marshalled.
      aWriter - the XMLStreamWriter to marshal the object to.
      aContext - a ILcdXMLDocumentContext which can be used to store and retrieve information which is shared between multiple marshallers. This context is unique per marshalled XML document.
      Throws:
      XMLStreamException - if any unexpected content occurs while marshalling the object.
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getElementName

      public QName getElementName()
      Returns the element name this adapter will write.
      Returns:
      the element name this adapter will write.