Class TLcdXMLTypeUnmarshallerProvider

java.lang.Object
com.luciad.format.xml.bind.schema.TLcdXMLTypeUnmarshallerProvider

public class TLcdXMLTypeUnmarshallerProvider extends Object
Provider of ILcdXMLTypeUnmarshaller's and ILcdXMLSchemaDatatypeUnmarshaller's that can unmarshal a specified XML Schema type or datatype to instances of a specified Java class.

This provider maintains two lookup tables:

  • a lookup table from each [XML Schema type, Java class] pair to its corresponding type unmarshaller
  • a lookup table from each [XML Schema simple type, Java class] pair to its corresponding datatype unmarshaller

Please refer to the com.luciad.format.xml.bind package documentation for a general overview of the XML Binding Framework.

Since:
9.0
See Also:
  • Method Details

    • registerTypeUnmarshaller

      public <T> void registerTypeUnmarshaller(TLcdXMLSchemaTypeIdentifier aTypeId, Class<T> aJavaClass, ILcdXMLTypeUnmarshaller<T> aUnmarshaller)
      Registers an ILcdXMLUnmarshaller which is capable of unmarshalling XML elements of the specified XML Schema type to instances of the specified Java class.
      Parameters:
      aTypeId - the XML Schema Type for which to register the unmarshaller.
      aJavaClass - the Java class to which XML elements will be unmarshalled.
      aUnmarshaller - the unmarshaller to be registered.
      Throws:
      NullPointerException - if one of the arguments is null.
    • getTypeUnmarshaller

      public <T> ILcdXMLTypeUnmarshaller<T> getTypeUnmarshaller(TLcdXMLSchemaTypeIdentifier aTypeId, Class<T> aJavaClass)
      Returns the unmarshaller which is capable of unmarshalling XML elements of the specified XML Schema type to instances of the specified Java class.
      Parameters:
      aTypeId - the XML Schema type for which to register the unmarshaller.
      aJavaClass - the Java class to which XML elements will be unmarshalled.
      Returns:
      the unmarshaller which is capable of unmarshalling XML elements of the specified XML Schema type to instances of the specified Java class, or null if no such unmarshaller was found.
      Throws:
      NullPointerException - if one of the arguments is null.
    • getTypeUnmarshaller

      public <T> ILcdXMLTypeUnmarshaller<? super T> getTypeUnmarshaller(TLcdXMLSchemaTypeIdentifier aTypeId, Class<T> aJavaClass, boolean aAllowClassSubstitution)
      Returns the unmarshaller which is capable of unmarshalling XML elements of the specified XML Schema type to instances of the specified Java class.
      Parameters:
      aTypeId - the XML Schema type for which to register the unmarshaller.
      aJavaClass - the Java class to which XML elements will be unmarshalled.
      aAllowClassSubstitution - if true, this unmarshaller provider will also search for unmarshallers for super classes and/or interfaces of the specified Java class, if no unmarshaller could be found for the specified class itself. The TLcdXMLJavaClassResolver of this provider is used to determine for which super classes and/or interfaces to search, and in which order.
      Returns:
      the unmarshaller which is capable of unmarshalling XML elements of the specified XML Schema type to instances of the specified Java class, or null if no such unmarshaller was found.
      Throws:
      NullPointerException - if one of the arguments is null.
    • registerDatatypeUnmarshaller

      public <T> void registerDatatypeUnmarshaller(TLcdXMLSchemaTypeIdentifier aTypeId, Class<T> aJavaClass, ILcdXMLDatatypeUnmarshaller<? extends T> aDatatypeUnmarshaller)
      Registers an ILcdXMLSchemaDatatypeUnmarshaller which is capable of parsing XML elements of the specified XML Schema simple type to instances of the specified Java class.
      Parameters:
      aTypeId - the XML Schema simple type for which to register the parser.
      aJavaClass - the Java class to which XML elements will be parsed.
      aDatatypeUnmarshaller - the parser to be registered.
      Throws:
      NullPointerException - if one of the arguments is null.
    • getDatatypeUnmarshaller

      public <T> ILcdXMLDatatypeUnmarshaller<? extends T> getDatatypeUnmarshaller(TLcdXMLSchemaTypeIdentifier aTypeId, Class<T> aJavaClass)
      Returns the datatype parser which is capable of parsing XML elements of the specified XML Schema simple type to instances of the specified Java class.
      Parameters:
      aTypeId - the XML Schema simple type for which to register the datatype parser.
      aJavaClass - the Java class to which XML elements will be parser.
      Returns:
      the datatype parser which is capable of parsing XML elements of the specified XML Schema simple type to instances of the specified Java class, or null if no such parser was found.
      Throws:
      NullPointerException - if one of the arguments is null.
    • getTypeClasses

      public Set<Class<?>> getTypeClasses(TLcdXMLSchemaTypeIdentifier aTypeId)
      Returns for the specified XSD Schema type identifier a set of all Java classes for which a schema type unmarshaller is registered.
      Parameters:
      aTypeId - the XSD Schema type identifier for which to return the corresponding Java classes.
      Returns:
      a set of all Java classes for which a schema type unmarshaller is registered for the specified XSD Schema type.
    • getDatatypeClasses

      public Set<Class<?>> getDatatypeClasses(TLcdXMLSchemaTypeIdentifier aTypeId)
      Returns for the specified XSD Schema datatype identifier a set of all Java classes for which a schema type unmarshaller is registered.
      Parameters:
      aTypeId - the XSD Schema datatype identifier for which to return the corresponding Java classes.
      Returns:
      a set of all Java classes for which a schema type unmarshaller is registered for the specified XSD Schema datatype.
    • getTypeIdentifiers

      public Set<TLcdXMLSchemaTypeIdentifier> getTypeIdentifiers(Class<?> aClass)
      Returns for the specified Java class a Set of all XSD Schema type identifiers for which a schema type unmarshaller is registered.
      Parameters:
      aClass - the XSD Schema type identifier for which to return the corresponding Java classes.
      Returns:
      a set of all XSD Schema type identifiers for which a schema type unmarshaller is registered for the specified Java class.
    • getDatatypeIdentifiers

      public Set<TLcdXMLSchemaTypeIdentifier> getDatatypeIdentifiers(Class<?> aClass)
      Returns for the specified Java class a Set of all XSD Schema datatype identifiers for which a schema type unmarshaller is registered.
      Parameters:
      aClass - the XSD Schema datatype identifier for which to return the corresponding Java classes.
      Returns:
      a set of all XSD Schema type identifiers for which a schema datatype unmarshaller is registered for the specified Java class.
    • toString

      public String toString()
      Returns a general description of this provider, containing a set of all [XML Schema type, Java class] pairs with their corresponding unmarshaller and all [XML Schema simple type, Java class] pairs with their corresponding datatype parser.

      The exact details of the representation are unspecified and are subject to change.

      Overrides:
      toString in class Object