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
.public class TLcdGML2ModelEncoder extends Object implements ILcdModelEncoder, ILcdOutputStreamFactoryCapable
save()
and
export()
methods), as well as the corresponding XML schema (using the
exportSchema()
method).
Current limitations and considerations:
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).
ILcdFeatured
ILcdGML3*
)ILcdXMLElement
TLcdEPSGReferenceParser
class, andConstructor and Description |
---|
TLcdGML2ModelEncoder()
Deprecated.
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.
|
Modifier and Type | Method and Description |
---|---|
boolean |
canExport(ILcdModel aModel,
String aDestination)
Deprecated.
Returns whether this encoder can export the specified model to the specified destination.
|
boolean |
canSave(ILcdModel aModel)
Deprecated.
Returns whether this model encoder can save the specified model to the location it originally came from.
|
void |
export(ILcdModel aModel,
String aDestination)
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.
|
String |
getDefaultNamespace()
Deprecated.
Returns the default XML namespace used by this encoder.
|
String |
getDisplayName()
Deprecated.
Returns a short, displayable name for the format this
ILcdModelEncoder encodes to. |
ILcdXMLTypedElementAdapterProvider |
getElementAdapterProvider()
Deprecated.
Returns the
ILcdXMLTypedElementAdapterProvider that is used by this
encoder. |
ILcdXMLElementNameProvider |
getElementNameProvider()
Deprecated.
Returns the
ILcdXMLElementNameProvider that is used by this encoder. |
ILcdOutputStreamFactory |
getOutputStreamFactory()
Deprecated.
Returns the output stream factory that is used by this model encoder.
|
ILcdXMLPrefixMap |
getPrefixMap()
Deprecated.
Returns the prefix map used by this encoder.
|
ILcdXMLSchemaLocationsMap |
getSchemaLocationsMap()
Deprecated.
Returns the schema locations map used by this encoder.
|
ILcdXMLEditableSchemaProvider |
getSchemaProvider()
Deprecated.
Returns the
ILcdXMLSchemaProvider that is used by this encoder. |
String |
getTargetNamespace()
Deprecated.
Returns the target namespace of the custom schema, in which dynamically created XML schema
types and elements are stored.
|
boolean |
isEncodeSchema()
Deprecated.
Returns
true if schemas are also encoded, each time a model is encoded ,
false otherwise. |
void |
registerElementAdapter(TLcdXMLName aTypeName,
Class aJavaClass,
ILcdXMLElementAdapter aAdapter)
Deprecated.
Registers a element adapter for the given XML type name and the given Java class.
|
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 |
registerElementName(Class aJavaClass,
TLcdXMLName aElementName)
Deprecated.
Registers an element name for the given Java class.
|
void |
save(ILcdModel aModel)
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.
|
public TLcdGML2ModelEncoder()
public TLcdGML2ModelEncoder(ILcdXMLEditableSchemaProvider aSchemaProvider)
public TLcdGML2ModelEncoder(ILcdXMLEditableSchemaProvider aSchemaProvider, TLcdGML2ElementNameProvider aElementNameProvider)
public void setOutputStreamFactory(ILcdOutputStreamFactory aOutputStreamFactory)
setOutputStreamFactory
in interface ILcdOutputStreamFactoryCapable
aOutputStreamFactory
- the output stream factory to be used by this model encoder.NullPointerException
- if aOutputStreamFactory == null
.public ILcdOutputStreamFactory getOutputStreamFactory()
getOutputStreamFactory
in interface ILcdOutputStreamFactoryCapable
setDefaultNamespace(String)
public void setPrefixMap(ILcdXMLPrefixMap aPrefixMap)
aPrefixMap
- the prefix map to be used by this encoder.TLcdXMLEncoder.setPrefixMap(com.luciad.format.xml.ILcdXMLPrefixMap)
public ILcdXMLPrefixMap getPrefixMap()
setPrefixMap(com.luciad.format.xml.ILcdXMLPrefixMap)
public void setSchemaLocationsMap(ILcdXMLSchemaLocationsMap aSchemaLocationsMap)
aSchemaLocationsMap
- the schema locations map to be registered. #see
com.luciad.format.xml.TLcdXMLEncoder#setSchemaLocationsMappublic ILcdXMLSchemaLocationsMap getSchemaLocationsMap()
setSchemaLocationsMap(com.luciad.format.xml.schema.ILcdXMLSchemaLocationsMap)
public void setDefaultNamespace(String aDefaultNamespace)
aDefaultNamespace
- TLcdXMLEncoder.setDefaultNamespace(String)
public String getDefaultNamespace()
setDefaultNamespace(String)
public ILcdXMLElementNameProvider getElementNameProvider()
ILcdXMLElementNameProvider
that is used by this encoder.ILcdXMLElementNameProvider
that is used by this encoder.public ILcdXMLTypedElementAdapterProvider getElementAdapterProvider()
ILcdXMLTypedElementAdapterProvider
that is used by this
encoder.ILcdXMLTypedElementAdapterProvider
that is used by this
encoder.public ILcdXMLEditableSchemaProvider getSchemaProvider()
ILcdXMLSchemaProvider
that is used by this encoder.ILcdXMLSchemaProvider
that is used by this encoder.public void registerElementName(Class aJavaClass, TLcdXMLName aElementName)
aJavaClass
- the Java class for which the name is to be registered.aElementName
- the element name to be registered.public void registerElementAdapter(TLcdXMLName aTypeName, Class aJavaClass, ILcdXMLElementAdapter aAdapter)
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.public void registerElementAdapter(TLcdXMLName aTypeName, TLcdXMLName[] aElementNameStack, Class aJavaClass, ILcdXMLElementAdapter aAdapter)
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.NullPointerException
- if aAdapter == null || aJavaClass == null
.public void setTargetNamespace(String aNamespace)
aNamespace
- ALcdGML3ElementNameProvider.setTargetNamespace(String)
public String getTargetNamespace()
ALcdGML3ElementNameProvider.getTargetNamespace()
public void setEncodeSchema(boolean aEncodeSchema)
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.aEncodeSchema
- boolean indicating whether to encode schemas or not.public boolean isEncodeSchema()
true
if schemas are also encoded, each time a model is encoded ,
false
otherwise.true
if schemas are encoded, false
otherwise.setEncodeSchema(boolean)
public String getDisplayName()
ILcdModelEncoder
ILcdModelEncoder
encodes to.getDisplayName
in interface ILcdModelEncoder
ILcdModelEncoder
.public boolean canSave(ILcdModel aModel)
ILcdModelEncoder
canSave
in interface ILcdModelEncoder
aModel
- the model to be verified.true
if this encoder can save the model in the location where it originally came from,
false
otherwise.ILcdModelEncoder.save(com.luciad.model.ILcdModel)
public void save(ILcdModel aModel) throws IllegalArgumentException, IOException
ILcdModelEncoder
save
in interface ILcdModelEncoder
aModel
- the model to be saved.IllegalArgumentException
- if the model cannot be saved by this encoder (!canSave(aModel)
).IOException
- if an I/O error occurs during encoding.public boolean canExport(ILcdModel aModel, String aDestination)
ILcdModelEncoder
canExport
in interface ILcdModelEncoder
aModel
- the model to be verified.aDestination
- the location where the model should be exported to.true
if this encoder can export the specified model to the
specified location, false
otherwise.ILcdModelEncoder.export(com.luciad.model.ILcdModel, java.lang.String)
public void export(ILcdModel aModel, String aDestination) throws IllegalArgumentException, IOException
ILcdModelEncoder
export
in interface ILcdModelEncoder
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.IllegalArgumentException
- if the model cannot be saved by this encoder (!canExport(aModel, aDestinationName)
).IOException
- if an I/O error occurs during encoding.public void exportSchema(ILcdModel aModel, String aDestination) throws IllegalArgumentException, IOException
aModel
- the model whose schema is to be exported.aDestination
- the destination to which the schema should be exported.IllegalArgumentException
IOException