Package com.luciad.format.gml3
Class TLcdGML2ModelEncoder
java.lang.Object
com.luciad.format.gml3.TLcdGML2ModelEncoder
- All Implemented Interfaces:
ILcdOutputStreamFactoryCapable,ILcdModelEncoder,Serializable
public class TLcdGML2ModelEncoder
extends Object
implements ILcdModelEncoder, ILcdOutputStreamFactoryCapable
Deprecated.
This encoder encodes models to GML 2 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 2.1.2 specification.
- The following classes/interfaces are currently supported for encoding:
- implementations of
ILcdShapethat have a corresponding definition in the GML specification (some LuciadLightspeed shapes do not have an equivalent in GML, e.g.,ILcdArcBandorILcdText). - implementations of
ILcdFeatured - implementations of the GML interfaces (
ILcdGML3*) - implementations of
ILcdXMLElement
- implementations of
- 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
TLcdEPSGReferenceParserclass, and
- All EPSG reference systems, supported by the
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionDeprecated.Creates a new GML2 model encoder, initialized with an appropriate element adapter provider, element name provider and schema provider.TLcdGML2ModelEncoder(ILcdXMLEditableSchemaProvider aSchemaProvider) Deprecated.TLcdGML2ModelEncoder(ILcdXMLEditableSchemaProvider aSchemaProvider, TLcdGML2ElementNameProvider aElementNameProvider) Deprecated.Creates a new GML2 model encoder, initialized with the given schema provider, and an appropriate element name and element adapter provider. -
Method Summary
Modifier and TypeMethodDescriptionbooleanDeprecated.Returns whether this encoder can export the specified model to the specified destination.booleanDeprecated.Returns whether this model encoder can save the specified model to the location it originally came from.voidDeprecated.Exports the specified model to the specified destination.voidexportSchema(ILcdModel aModel, String aDestination) Deprecated.Exports the schema for the given model to the specified destination.Deprecated.Returns the default XML namespace used by this encoder.Deprecated.Returns a short, displayable name for the format thisILcdModelEncoderencodes to.Deprecated.Returns theILcdXMLTypedElementAdapterProviderthat is used by this encoder.Deprecated.Returns theILcdXMLElementNameProviderthat is used by this encoder.Deprecated.Returns the output stream factory that is used by this model encoder.Deprecated.Returns the prefix map used by this encoder.Deprecated.Returns the schema locations map used by this encoder.Deprecated.Returns theILcdXMLSchemaProviderthat is used by this encoder.Deprecated.Returns the target namespace of the custom schema, in which dynamically created XML schema types and elements are stored.booleanDeprecated.Returnstrueif schemas are also encoded, each time a model is encoded ,falseotherwise.voidregisterElementAdapter(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.voidregisterElementAdapter(TLcdXMLName aTypeName, Class aJavaClass, ILcdXMLElementAdapter aAdapter) Deprecated.Registers a element adapter for the given XML type name and the given Java class.voidregisterElementName(Class aJavaClass, TLcdXMLName aElementName) Deprecated.Registers an element name for the given Java class.voidDeprecated.Saves the model to the location where it originally came from.voidsetDefaultNamespace(String aDefaultNamespace) Deprecated.Sets the default XML namespace for the documents created by this encoder.voidsetEncodeSchema(boolean aEncodeSchema) Deprecated.Sets whether to encode the schema each time a model is encoded, or not.voidsetOutputStreamFactory(ILcdOutputStreamFactory aOutputStreamFactory) Deprecated.Sets the output stream factory to be used by this model encoder.voidsetPrefixMap(ILcdXMLPrefixMap aPrefixMap) Deprecated.Sets the prefix map to be used by this encoder.voidsetSchemaLocationsMap(ILcdXMLSchemaLocationsMap aSchemaLocationsMap) Deprecated.Sets the schema locations map to be used by this encoder.voidsetTargetNamespace(String aNamespace) Deprecated.Sets the target namespace for the XML documents to be generated.
-
Constructor Details
-
TLcdGML2ModelEncoder
public TLcdGML2ModelEncoder()Deprecated.Creates a new GML2 model encoder, initialized with an appropriate element adapter provider, element name provider and schema provider. -
TLcdGML2ModelEncoder
Deprecated. -
TLcdGML2ModelEncoder
public TLcdGML2ModelEncoder(ILcdXMLEditableSchemaProvider aSchemaProvider, TLcdGML2ElementNameProvider aElementNameProvider) Deprecated.Creates a new GML2 model encoder, initialized with the given schema provider, and an appropriate element name and element adapter provider.
-
-
Method Details
-
setOutputStreamFactory
Deprecated.Sets the output stream factory to be used by this model encoder.- Specified by:
setOutputStreamFactoryin interfaceILcdOutputStreamFactoryCapable- Parameters:
aOutputStreamFactory- the output stream factory to be used by this model encoder.- Throws:
NullPointerException- ifaOutputStreamFactory == null.
-
getOutputStreamFactory
Deprecated.Returns the output stream factory that is used by this model encoder.- Specified by:
getOutputStreamFactoryin interfaceILcdOutputStreamFactoryCapable- Returns:
- the output stream factory that is used by this model encoder.
- See Also:
-
setPrefixMap
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
Deprecated.Returns the prefix map used by this encoder.- Returns:
- the prefix map used by this encoder.
- See Also:
-
setSchemaLocationsMap
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
Deprecated.Returns the schema locations map used by this encoder.- Returns:
- the schema locations map used by this encoder.
- See Also:
-
setDefaultNamespace
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
Deprecated.Returns the default XML namespace used by this encoder.- Returns:
- the default XML namespace used by this encoder.
- See Also:
-
getElementNameProvider
Deprecated.Returns theILcdXMLElementNameProviderthat is used by this encoder.- Returns:
- the
ILcdXMLElementNameProviderthat is used by this encoder.
-
getElementAdapterProvider
Deprecated.Returns theILcdXMLTypedElementAdapterProviderthat is used by this encoder.- Returns:
- the
ILcdXMLTypedElementAdapterProviderthat is used by this encoder.
-
getSchemaProvider
Deprecated.Returns theILcdXMLSchemaProviderthat is used by this encoder.- Returns:
- the
ILcdXMLSchemaProviderthat is used by this encoder.
-
registerElementName
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 aAdapter) 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.aAdapter- 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- ifaAdapter == null || aJavaClass == null.
-
setTargetNamespace
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:
-
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:
-
setEncodeSchema
public void setEncodeSchema(boolean aEncodeSchema) Deprecated.Sets whether to encode the schema each time a model is encoded, or not. Iftrue, the schema will be stored at the same location as the XML file, but with extension '.xsd'. Iffalse, only the model will be encoded.- Parameters:
aEncodeSchema- boolean indicating whether to encode schemas or not.
-
isEncodeSchema
public boolean isEncodeSchema()Deprecated.Returnstrueif schemas are also encoded, each time a model is encoded ,falseotherwise.- Returns:
trueif schemas are encoded,falseotherwise.- See Also:
-
getDisplayName
Deprecated.Description copied from interface:ILcdModelEncoderReturns a short, displayable name for the format thisILcdModelEncoderencodes to.- Specified by:
getDisplayNamein interfaceILcdModelEncoder- Returns:
- the displayable name of this
ILcdModelEncoder.
-
canSave
Deprecated.Description copied from interface:ILcdModelEncoderReturns 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:
canSavein interfaceILcdModelEncoder- Parameters:
aModel- the model to be verified.- Returns:
trueif this encoder can save the model in the location where it originally came from,falseotherwise.- See Also:
-
save
Deprecated.Description copied from interface:ILcdModelEncoderSaves the model to the location where it originally came from.- Specified by:
savein interfaceILcdModelEncoder- 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
Deprecated.Description copied from interface:ILcdModelEncoderReturns 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:
canExportin interfaceILcdModelEncoder- Parameters:
aModel- the model to be verified.aDestination- the location where the model should be exported to.- Returns:
trueif this encoder can export the specified model to the specified location,falseotherwise.- See Also:
-
export
public void export(ILcdModel aModel, String aDestination) throws IllegalArgumentException, IOException Deprecated.Description copied from interface:ILcdModelEncoderExports the specified model to the specified destination.- Specified by:
exportin interfaceILcdModelEncoder- 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:
IllegalArgumentExceptionIOException
-
com.luciad.format.gml3.*packages are replaced by new decoders and encoders in the packagescom.luciad.format.gml2.xml,com.luciad.format.gml31.xmlandcom.luciad.format.gml32.xml.