Class TLcdGML3ModelEncoder

java.lang.Object
com.luciad.format.gml3.TLcdGML3ModelEncoder
All Implemented Interfaces:
ILcdOutputStreamFactoryCapable, ILcdModelEncoder, Serializable

public class TLcdGML3ModelEncoder extends Object implements ILcdModelEncoder, ILcdOutputStreamFactoryCapable
Deprecated.
This class has been deprecated. The GML decoders and encoders in the com.luciad.format.gml3.* packages are replaced by new decoders and encoders in the packages com.luciad.format.gml2.xml, com.luciad.format.gml31.xml and com.luciad.format.gml32.xml.
This encoder encodes models to GML 3 documents.

For a given model, the decoder can generate an XML document (using the save() and export() methods), as well as the corresponding XML schema (using the exportSchema() method).

Current limitations and considerations:

  • The document will be encoded according to the GML 3.1.1 specification.
  • The following classes/interfaces are currently supported for encoding:
    • implementations of ILcdShape that have a corresponding definition in the GML specification (some LuciadLightspeed shapes do not have an equivalent in GML, e.g., ILcdArcBand or ILcdText).
    • implementations of ILcdFeatured
    • implementations of the GML interfaces (ILcdGML3*)
    • implementations of ILcdXMLElement
  • XLINK references are currently not supported. Objects which are referenced from different other objects will be encoded as many times as they are referred.
  • Currently, the following coordinate reference systems are supported:
    • All EPSG reference systems, supported by the TLcdEPSGReferenceParser class, and
See Also:
  • Constructor Details

    • TLcdGML3ModelEncoder

      public TLcdGML3ModelEncoder()
      Deprecated.
      Creates a new GML3 model encoder, initialized with an appropriate element adapter provider, element name provider and schema provider.
    • TLcdGML3ModelEncoder

      public TLcdGML3ModelEncoder(ILcdXMLEditableSchemaProvider aSchemaProvider)
      Deprecated.
    • TLcdGML3ModelEncoder

      public TLcdGML3ModelEncoder(ILcdXMLEditableSchemaProvider aSchemaProvider, TLcdGML3ElementNameProvider aElementNameProvider)
      Deprecated.
      Creates a new GML3 model encoder, initialized with the given schema provider, and an appropriate element name and element adapter provider.
  • Method Details

    • setOutputStreamFactory

      public void setOutputStreamFactory(ILcdOutputStreamFactory aOutputStreamFactory)
      Deprecated.
      Sets the output stream factory to be used by this model encoder.
      Specified by:
      setOutputStreamFactory in interface ILcdOutputStreamFactoryCapable
      Parameters:
      aOutputStreamFactory - the output stream factory to be used by this model encoder.
      Throws:
      NullPointerException - if aOutputStreamFactory == null.
    • getOutputStreamFactory

      public ILcdOutputStreamFactory getOutputStreamFactory()
      Deprecated.
      Returns the output stream factory that is used by this model encoder.
      Specified by:
      getOutputStreamFactory in interface ILcdOutputStreamFactoryCapable
      Returns:
      the output stream factory that is used by this model encoder.
      See Also:
    • setPrefixMap

      public void setPrefixMap(ILcdXMLPrefixMap aPrefixMap)
      Deprecated.
      Sets the prefix map to be used by this encoder.
      Parameters:
      aPrefixMap - the prefix map to be used by this encoder.
      See Also:
    • getPrefixMap

      public ILcdXMLPrefixMap getPrefixMap()
      Deprecated.
      Returns the prefix map used by this encoder.
      Returns:
      the prefix map used by this encoder.
      See Also:
    • setSchemaLocationsMap

      public void setSchemaLocationsMap(ILcdXMLSchemaLocationsMap aSchemaLocationsMap)
      Deprecated.
      Sets the schema locations map to be used by this encoder.
      Parameters:
      aSchemaLocationsMap - the schema locations map to be registered. #see com.luciad.format.xml.TLcdXMLEncoder#setSchemaLocationsMap
    • getSchemaLocationsMap

      public ILcdXMLSchemaLocationsMap getSchemaLocationsMap()
      Deprecated.
      Returns the schema locations map used by this encoder.
      Returns:
      the schema locations map used by this encoder.
      See Also:
    • setDefaultNamespace

      public void setDefaultNamespace(String aDefaultNamespace)
      Deprecated.
      Sets the default XML namespace for the documents created by this encoder. This is the namespace for which no prefix will be used in the generated XML documents. It does not have to be the same as the target namespace.
      Parameters:
      aDefaultNamespace -
      See Also:
    • getDefaultNamespace

      public String getDefaultNamespace()
      Deprecated.
      Returns the default XML namespace used by this encoder.
      Returns:
      the default XML namespace used by this encoder.
      See Also:
    • getElementNameProvider

      public ILcdXMLElementNameProvider getElementNameProvider()
      Deprecated.
      Returns the ILcdXMLElementNameProvider that is used by this encoder.
      Returns:
      the ILcdXMLElementNameProvider that is used by this encoder.
    • getElementAdapterProvider

      public ILcdXMLTypedElementAdapterProvider getElementAdapterProvider()
      Deprecated.
      Returns the ILcdXMLTypedElementAdapterProvider that is used by this encoder.
      Returns:
      the ILcdXMLTypedElementAdapterProvider that is used by this encoder.
    • getSchemaProvider

      public ILcdXMLEditableSchemaProvider getSchemaProvider()
      Deprecated.
      Returns the ILcdXMLSchemaProvider that is used by this encoder.
      Returns:
      the ILcdXMLSchemaProvider that is used by this encoder.
    • registerElementName

      public void registerElementName(Class aJavaClass, TLcdXMLName aElementName)
      Deprecated.
      Registers an element name for the given Java class.
      Parameters:
      aJavaClass - the Java class for which the name is to be registered.
      aElementName - the element name to be registered.
    • registerElementAdapter

      public void registerElementAdapter(TLcdXMLName aTypeName, Class aJavaClass, ILcdXMLElementAdapter aElementAdapter)
      Deprecated.
      Registers a element adapter for the given XML type name and the given Java class.
      Parameters:
      aTypeName - the XML type name for which to register the given element adapter.
      aJavaClass - the Java class for which to register the given element adapter.
      aElementAdapter - the element adapter to be registered.
    • registerElementAdapter

      public void registerElementAdapter(TLcdXMLName aTypeName, TLcdXMLName[] aElementNameStack, Class aJavaClass, ILcdXMLElementAdapter aAdapter)
      Deprecated.
      Registers the given adapter for the anonymous XML type, identified by the element name stack, and, if the element name stack is contained within a named type, the name of that type.
      Parameters:
      aTypeName - The XML type name from which the specified element name stack is part of.
      aElementNameStack - The element name stack, identifying the XML type within the provided XML type.
      aAdapter - the adapter to be registered.
      Throws:
      NullPointerException - if aAdapter == null || aJavaClass == null.
    • setTargetNamespace

      public void setTargetNamespace(String aNamespace)
      Deprecated.
      Sets the target namespace for the XML documents to be generated. All dynamically created custom schema types and elements (feature types and feature elements) will be created within this namespace.
      Parameters:
      aNamespace -
      See Also:
      • ALcdGML3ElementNameProvider.setTargetNamespace(String)
    • getTargetNamespace

      public String getTargetNamespace()
      Deprecated.
      Returns the target namespace of the custom schema, in which dynamically created XML schema types and elements are stored.
      Returns:
      the target namespace of the custom schema.
      See Also:
      • ALcdGML3ElementNameProvider.getTargetNamespace()
    • setEncodeSchema

      public void setEncodeSchema(boolean aEncodeSchema)
      Deprecated.
      Sets whether to encode the schema each time a model is encoded, or not. If true, the schema will be stored at the same location as the XML file, but with extension '.xsd'. If false, only the model will be encoded.
      Parameters:
      aEncodeSchema - boolean indicating whether to encode schemas or not.
    • isEncodeSchema

      public boolean isEncodeSchema()
      Deprecated.
      Returns true if schemas are also encoded, each time a model is encoded , false otherwise.
      Returns:
      true if schemas are encoded, false otherwise.
      See Also:
    • getDisplayName

      public String getDisplayName()
      Deprecated.
      Description copied from interface: ILcdModelEncoder
      Returns a short, displayable name for the format this ILcdModelEncoder encodes to.
      Specified by:
      getDisplayName in interface ILcdModelEncoder
      Returns:
      the displayable name of this ILcdModelEncoder.
    • canSave

      public boolean canSave(ILcdModel aModel)
      Deprecated.
      Description copied from interface: ILcdModelEncoder
      Returns whether this model encoder can save the specified model to the location it originally came from. Often this will only be a simple test, for example checking the type of the model's model descriptor.
      Specified by:
      canSave in interface ILcdModelEncoder
      Parameters:
      aModel - the model to be verified.
      Returns:
      true if this encoder can save the model in the location where it originally came from, false otherwise.
      See Also:
    • save

      public void save(ILcdModel aModel) throws IllegalArgumentException, IOException
      Deprecated.
      Description copied from interface: ILcdModelEncoder
      Saves the model to the location where it originally came from.
      Specified by:
      save in interface ILcdModelEncoder
      Parameters:
      aModel - the model to be saved.
      Throws:
      IllegalArgumentException - if the model cannot be saved by this encoder (!canSave(aModel)).
      IOException - if an I/O error occurs during encoding.
    • canExport

      public boolean canExport(ILcdModel aModel, String aDestination)
      Deprecated.
      Description copied from interface: ILcdModelEncoder
      Returns whether this encoder can export the specified model to the specified destination. This method will typically check whether the contents of the specified model are compatible with the format this encoder is written for.
      Specified by:
      canExport in interface ILcdModelEncoder
      Parameters:
      aModel - the model to be verified.
      aDestination - the location where the model should be exported to.
      Returns:
      true if this encoder can export the specified model to the specified location, false otherwise.
      See Also:
    • export

      public void export(ILcdModel aModel, String aDestination) throws IllegalArgumentException, IOException
      Deprecated.
      Description copied from interface: ILcdModelEncoder
      Exports the specified model to the specified destination.
      Specified by:
      export in interface ILcdModelEncoder
      Parameters:
      aModel - the model to be exported.
      aDestination - the location where the model should be saved. Typically, this is a name for the output file, but it can also point to a file containing the required properties to create a set of data files.
      Throws:
      IllegalArgumentException - if the model cannot be saved by this encoder (!canExport(aModel, aDestinationName)).
      IOException - if an I/O error occurs during encoding.
    • exportSchema

      public void exportSchema(ILcdModel aModel, String aDestination) throws IllegalArgumentException, IOException
      Deprecated.
      Exports the schema for the given model to the specified destination.
      Parameters:
      aModel - the model whose schema is to be exported.
      aDestination - the destination to which the schema should be exported.
      Throws:
      IllegalArgumentException
      IOException