Package com.luciad.format.gml3
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 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
orILcdText).
- 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
TLcdEPSGReferenceParser
class, and
- All EPSG reference systems, supported by the
- See Also:
-
Constructor Summary
ConstructorDescriptionDeprecated.Creates a new GML3 model encoder, initialized with an appropriate element adapter provider, element name provider and schema provider.TLcdGML3ModelEncoder
(ILcdXMLEditableSchemaProvider aSchemaProvider) Deprecated.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 Summary
Modifier and TypeMethodDescriptionboolean
Deprecated.Returns whether this encoder can export the specified model to the specified destination.boolean
Deprecated.Returns whether this model encoder can save the specified model to the location it originally came from.void
Deprecated.Exports the specified model to the specified destination.void
exportSchema
(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 thisILcdModelEncoder
encodes to.Deprecated.Returns theILcdXMLTypedElementAdapterProvider
that is used by this encoder.Deprecated.Returns theILcdXMLElementNameProvider
that 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 theILcdXMLSchemaProvider
that 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.boolean
Deprecated.Returnstrue
if schemas are also encoded, each time a model is encoded ,false
otherwise.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.void
registerElementAdapter
(TLcdXMLName aTypeName, Class aJavaClass, ILcdXMLElementAdapter aElementAdapter) Deprecated.Registers a element adapter for the given XML type name and the given Java class.void
registerElementName
(Class aJavaClass, TLcdXMLName aElementName) Deprecated.Registers an element name for the given Java class.void
Deprecated.Saves the model to the location where it originally came from.void
setDefaultNamespace
(String aDefaultNamespace) Deprecated.Sets the default XML namespace for the documents created by this encoder.void
setEncodeSchema
(boolean aEncodeSchema) Deprecated.Sets whether to encode the schema each time a model is encoded, or not.void
setOutputStreamFactory
(ILcdOutputStreamFactory aOutputStreamFactory) Deprecated.Sets the output stream factory to be used by this model encoder.void
setPrefixMap
(ILcdXMLPrefixMap aPrefixMap) Deprecated.Sets the prefix map to be used by this encoder.void
setSchemaLocationsMap
(ILcdXMLSchemaLocationsMap aSchemaLocationsMap) Deprecated.Sets the schema locations map to be used by this encoder.void
setTargetNamespace
(String aNamespace) Deprecated.Sets the target namespace for the XML documents to be generated.
-
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
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
Deprecated.Sets the output stream factory to be used by this model encoder.- Specified by:
setOutputStreamFactory
in 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:
getOutputStreamFactory
in 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 theILcdXMLElementNameProvider
that is used by this encoder.- Returns:
- the
ILcdXMLElementNameProvider
that is used by this encoder.
-
getElementAdapterProvider
Deprecated.Returns theILcdXMLTypedElementAdapterProvider
that is used by this encoder.- Returns:
- the
ILcdXMLTypedElementAdapterProvider
that is used by this encoder.
-
getSchemaProvider
Deprecated.Returns theILcdXMLSchemaProvider
that is used by this encoder.- Returns:
- the
ILcdXMLSchemaProvider
that 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 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
- 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.Returnstrue
if schemas are also encoded, each time a model is encoded ,false
otherwise.- Returns:
true
if schemas are encoded,false
otherwise.- See Also:
-
getDisplayName
Deprecated.Description copied from interface:ILcdModelEncoder
Returns a short, displayable name for the format thisILcdModelEncoder
encodes to.- Specified by:
getDisplayName
in interfaceILcdModelEncoder
- Returns:
- the displayable name of this
ILcdModelEncoder
.
-
canSave
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 interfaceILcdModelEncoder
- 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
Deprecated.Description copied from interface:ILcdModelEncoder
Saves the model to the location where it originally came from.- Specified by:
save
in 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: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 interfaceILcdModelEncoder
- 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 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:
IllegalArgumentException
IOException
-
com.luciad.format.gml3.*
packages are replaced by new decoders and encoders in the packagescom.luciad.format.gml2.xml
,com.luciad.format.gml31.xml
andcom.luciad.format.gml32.xml
.