Class TLcdXMLUnmarshallerProvider

java.lang.Object
com.luciad.format.xml.bind.TLcdXMLUnmarshallerProvider
Direct Known Subclasses:
TLcdXMLSchemaBasedUnmarshallerProvider

public class TLcdXMLUnmarshallerProvider extends Object
Provider of ILcdXMLUnmarshaller's that can unmarshal a specified XML element to instances of a specified Java class.

This provider maintains a lookup table from each [XML element, Java class] pair to its corresponding unmarshaller. If an unmarshaller is registered for a specified class, it will automatically also be registered for all the ancestor classes and implemented interfaces of that class.

One TLcdXMLUnmarshallerProvider instance represents one set of unmarshallers which can delegate to each other and which, all together, should be capable of unmarshalling instances of one or more particular types of XML documents.

Please refer to the package documentation for a general overview of the XML Binding Framework.

Since:
8.2
See Also:
  • Constructor Details

    • TLcdXMLUnmarshallerProvider

      public TLcdXMLUnmarshallerProvider()
  • Method Details

    • registerUnmarshaller

      public <T> void registerUnmarshaller(QName aXMLElementName, Class<T> aJavaClass, ILcdXMLUnmarshaller<? extends T> aUnmarshaller)
      Registers an ILcdXMLUnmarshaller which is capable of unmarshalling the specified XML element to the specified Java class.

      The XML element name should be unique. Therefore, in the context of XML Schema, only unmarshallers for global elements should be registered on this provider (local elements are not guaranteed to be unique).

      Parameters:
      aXMLElementName - the XML element which the specified unmarshaller can read.
      aJavaClass - the Java class to which the specified XML element is unmarshalled.
      aUnmarshaller - the unmarshaller to be registered.
      Throws:
      NullPointerException - if one of the arguments is null.
    • getUnmarshaller

      public <T> ILcdXMLUnmarshaller<? extends T> getUnmarshaller(QName aXMLGlobalElementName, Class<T> aJavaClass)
      Returns an unmarshaller which is capable of unmarshalling the specified XML element into an instance of a Java class which is assignable to a field of the specified Java class.
      Parameters:
      aXMLGlobalElementName - the XML element which can be unmarshalled by the unmarshaller to be returned.
      aJavaClass - the Java class of the field to which the unmarshalled Java object should be assignable.
      Returns:
      an unmarshaller for unmarshalling the specified XML element to an instance of the specified Java class, or null if no such unmarshaller was found.