Class TLcdXMLDataObjectSchemaHandler

java.lang.Object
com.luciad.format.xml.bind.schema.dataobject.TLcdXMLDataObjectSchemaHandler
All Implemented Interfaces:
ILcdXMLSchemaHandler

public class TLcdXMLDataObjectSchemaHandler extends Object implements ILcdXMLSchemaHandler
Enables automatic support for decoding documents containing XML schemas for which the decoder is not configured.

When a new schema definition is found, the TLcdXMLDataObjectSchemaHandler will generate a new data model for this schema using a TLcdXMLDataModelBuilder. The handler then configures the TLcdXMLSchemaBasedDecoder which is set on it with the new data model such that it can decode data compliant with this new schema.

Typical use:


   TLcdXMLDataObjectSchemaHandler schemaHandler = new TLcdXMLDataObjectSchemaHandler();
   TLcdXMLSchemaBasedDecoder decoder = new TLcdXMLSchemaBasedDecoder(schemaHandler, new TLcdXMLSchemaBasedMapping());
   schemaHandler.setDecoder(decoder);

   // the decoder is now ready to use
   decoder.decode(...);
 
Since:
10.0
  • Constructor Details

    • TLcdXMLDataObjectSchemaHandler

      public TLcdXMLDataObjectSchemaHandler()
      Creates a new TLcdXMLDataObjectSchemaHandler.

      After construction, a decoder should be set.

    • TLcdXMLDataObjectSchemaHandler

      @Deprecated public TLcdXMLDataObjectSchemaHandler(EntityResolver2 aEntityResolver)
      Deprecated.
      Use TLcdXMLDataObjectSchemaHandler() and configure the entity resolver on the TLcdXMLSchemaBasedMapping.
      Creates a new TLcdXMLDataObjectSchemaHandler using the specified entity resolver for looking up all its schemas to be read.
      Parameters:
      aEntityResolver - the entity resolver for looking up all the schemas to be read.
    • TLcdXMLDataObjectSchemaHandler

      @Deprecated public TLcdXMLDataObjectSchemaHandler(EntityResolver2 aEntityResolver, boolean aImplementFeatured)
      Deprecated.
      Use TLcdXMLDataObjectSchemaHandler() and configure the entity resolver on the TLcdXMLSchemaBasedMapping.
      Creates a new TLcdXMLDataObjectSchemaHandler using the specified entity resolver for looking up all its schemas to be read. The second parameter determines if the instance object of extension data types should implement ILcdFeatured.
      Parameters:
      aEntityResolver - the entity resolver for looking up all the schemas to be read.
      aImplementFeatured - determines if extension objects should implement ILcdFeatured
    • TLcdXMLDataObjectSchemaHandler

      public TLcdXMLDataObjectSchemaHandler(boolean aImplementFeatured)
      Creates a new TLcdXMLDataObjectSchemaHandler. The parameter determines if the instance object of extension data types should implement ILcdFeatured.

      After construction, a decoder should be set.

      Parameters:
      aImplementFeatured - determines if extension objects should implement ILcdFeatured resolver on the TLcdXMLSchemaBasedMapping.
  • Method Details

    • setDecoder

      public void setDecoder(TLcdXMLSchemaBasedDecoder aDecoder)
      Sets the XML decoder that will be configured for the XML schemas which are processed by this handler.
      Parameters:
      aDecoder - the XML decoder that will be configured for the XML schemas which are processed by this handler.
      See Also:
    • getDecoder

      public TLcdXMLSchemaBasedDecoder getDecoder()
      Gets the XML decoder that will be configured for the XML schemas which are processed by this handler.
      Returns:
      the XML decoder of this handler
      See Also:
    • handleSchema

      public void handleSchema(String aNamespaceURI, String aBaseURI, String aSystemID) throws IOException
      Description copied from interface: ILcdXMLSchemaHandler
      Allows an application to process the specified schema and perform the necessary steps (register new unmarshallers, schema elements, ...) to deal with the specified schema.
      Specified by:
      handleSchema in interface ILcdXMLSchemaHandler
      Parameters:
      aNamespaceURI - the namespace URI of the schema to be read.
      aBaseURI - the base URI relative to which relative system ID's should be resolved.
      aSystemID - the system ID, absolute or relative, of the XML Schema to be handled.
      Throws:
      IOException - if an exception occurs while reading or processing the schema.