@LcdService(service=ILcdModelEncoder.class, priority=20000) public class TLcdGML32ModelEncoder extends ALcdXMLModelEncoder
File | Description |
---|---|
*.gml, *.gml32, *.xml | GML 3.2 data file |
*.xsd | Application schema (XML Schema) |
outputStreamFactory
of this encoder.TLcdGML32ModelDecoder
and models
having a TLcdGML32ModelDescriptor
. These models are instances of TLcdGML32Model
or TLcdGML32AbstractFeatureCollection
. Model elements are instances of TLcdGML32AbstractFeature
.ILcdShape/ILcdDataObject
elements.
Nested features are also supported.Java class | GML geometry type |
---|---|
ILcdPoint | gml:PointType |
ILcdPolyline | gml:LineStringType |
ILcdCircle | gml:CurveType |
ILcdCircleBy3Points | gml:CurveType |
ILcdCircularArcBy3Points | gml:CurveType |
ILcdCircularArcByBulge | gml:CurveType |
ILcdCircularArcByCenterPoint | gml:CurveType |
ILcdCircularArc | gml:CurveType |
ILcdCompositeCurve | gml:CompositeCurveType |
ILcdPolygon | gml:PolygonType |
ILcdComplexPolygon | gml:SurfaceType |
ILcdSurface | gml:SurfaceType |
ILcdShapeList | gml:MultiGeometryType |
Java class | XSD type |
---|---|
Boolean | xsd:boolean |
Byte | xsd:byte |
Short | xsd:short |
Integer | xsd:int |
Long | xsd:long |
Float | xsd:float |
Double | xsd:double |
TLcdOGCModelReferenceFormatter
.
ILcdModelEncoder encoder = new TLcdGML32ModelEncoder();
encoder.export(model, "world.gml32");
Constructor and Description |
---|
TLcdGML32ModelEncoder()
Creates a new
TLcdGML32ModelEncoder , ready to use. |
Modifier and Type | Method and Description |
---|---|
boolean |
canExport(ILcdModel aModel,
String aDestinationName)
Returns whether this encoder can export the specified model to the specified destination.
|
boolean |
canSave(ILcdModel aModel)
Returns whether this model encoder can save the specified model to the location it originally came from.
|
protected String |
createSchemaLocation(String aNamespaceURI,
String aDefaultSchemaLocation,
String aDestinationName)
Returns a schema location for the specified namespace URI to be encoded in the "xsi:schemaLocations"
attribute in the generated XML documents.
|
void |
export(ILcdModel aModel,
Result aDestination)
Exports the given model to a destination result.
|
void |
export(ILcdModel aModel,
String aDestinationName)
Exports the specified model to the specified destination.
|
void |
exportSchema(ILcdModel aModel,
String aDestinationName)
Exports the XML schema for the specified model to the specified destination.
|
String |
getDefaultTargetNamespace()
Returns the default target application schema namespace.
|
String |
getDisplayName()
Returns a short, displayable name for the format this
ILcdModelEncoder encodes to. |
EntityResolver2 |
getEntityResolver()
Returns the
org.xml.sax.ext.EntityResolver2 that is used for creating input sources for
XSD schemas. |
ILcdModelReferenceFormatter |
getModelReferenceFormatter()
Returns the model reference formatter that is used to format
ILcdModelReference
instances when encoding an srsName. |
ILcdOutputStreamFactory |
getOutputStreamFactory()
Returns the
ILcdOutputStreamFactory that is used for creating output streams. |
XMLOutputFactory |
getXMLOutputFactory()
Returns the
javax.xml.stream.XMLOutputFactory that is used by this encoder for creating
javax.xml.stream.XMLStreamWriter instances. |
boolean |
isAutoEncodeSchema()
Returns
true if the schema is automatically encoded when a model is encoded, false otherwise. |
void |
save(ILcdModel aModel)
Saves the model to the location where it originally came from.
|
void |
setAutoEncodeSchema(boolean aAutoEncodeSchema)
Sets whether a schema is to be encoded automatically when a model is encoded.
|
void |
setDefaultTargetNamespace(String aTargetNamespace)
Sets the default target application schema namespace.
|
void |
setEntityResolver(EntityResolver2 aEntityResolver)
Sets the
org.xml.sax.ext.EntityResolver2 to be used for creating input sources for XSD
schemas. |
void |
setModelReferenceFormatter(ILcdModelReferenceFormatter aModelReferenceFormatter)
Sets the formatter that is used to format
ILcdModelReference instances
when encoding an srsName. |
void |
setOutputStreamFactory(ILcdOutputStreamFactory aOutputStreamFactory)
Sets the
ILcdOutputStreamFactory to be used for creating output streams. |
void |
setXMLOutputFactory(XMLOutputFactory aXMLOutputFactory)
Sets the
javax.xml.stream.XMLOutputFactory to be used by this encoder for creating
javax.xml.stream.XMLStreamWriter instances. |
String |
toString() |
public TLcdGML32ModelEncoder()
TLcdGML32ModelEncoder
, ready to use.public boolean canSave(ILcdModel aModel)
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 String getDisplayName()
ILcdModelEncoder
ILcdModelEncoder
encodes to.ILcdModelEncoder
.public EntityResolver2 getEntityResolver()
ALcdXMLModelEncoder
org.xml.sax.ext.EntityResolver2
that is used for creating input sources for
XSD schemas.getEntityResolver
in class ALcdXMLModelEncoder
public ILcdOutputStreamFactory getOutputStreamFactory()
ALcdXMLModelEncoder
ILcdOutputStreamFactory
that is used for creating output streams.getOutputStreamFactory
in interface ILcdOutputStreamFactoryCapable
getOutputStreamFactory
in class ALcdXMLModelEncoder
ILcdOutputStreamFactory
that is used for creating output streams.ALcdXMLModelEncoder.setOutputStreamFactory(com.luciad.io.ILcdOutputStreamFactory)
public XMLOutputFactory getXMLOutputFactory()
ALcdXMLModelEncoder
javax.xml.stream.XMLOutputFactory
that is used by this encoder for creating
javax.xml.stream.XMLStreamWriter
instances.getXMLOutputFactory
in class ALcdXMLModelEncoder
javax.xml.stream.XMLOutputFactory
that is used by this encoder for creating
javax.xml.stream.XMLStreamWriter
instances.public void save(ILcdModel aModel) throws IllegalArgumentException, IOException
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 void setEntityResolver(EntityResolver2 aEntityResolver)
ALcdXMLModelEncoder
org.xml.sax.ext.EntityResolver2
to be used for creating input sources for XSD
schemas. This entity resolver is only used for retrieving runtime extension schemas.setEntityResolver
in class ALcdXMLModelEncoder
aEntityResolver
- the entity resolver to be used for creating input sources for XSD
schemas.public void setOutputStreamFactory(ILcdOutputStreamFactory aOutputStreamFactory)
ALcdXMLModelEncoder
ILcdOutputStreamFactory
to be used for creating output streams. This
output stream factory is used for output streams for both the data files and the XSD schemas.setOutputStreamFactory
in interface ILcdOutputStreamFactoryCapable
setOutputStreamFactory
in class ALcdXMLModelEncoder
aOutputStreamFactory
- the output stream factory to be used by this model encoder.ALcdXMLModelEncoder.setOutputStreamFactory(com.luciad.io.ILcdOutputStreamFactory)
public void setXMLOutputFactory(XMLOutputFactory aXMLOutputFactory)
ALcdXMLModelEncoder
javax.xml.stream.XMLOutputFactory
to be used by this encoder for creating
javax.xml.stream.XMLStreamWriter
instances.setXMLOutputFactory
in class ALcdXMLModelEncoder
aXMLOutputFactory
- the javax.xml.stream.XMLOutputFactory
to be used by this encoder
for creating javax.xml.stream.XMLStreamWriter
instances.public String getDefaultTargetNamespace()
public void setDefaultTargetNamespace(String aTargetNamespace)
aTargetNamespace
- the default namespace for generated application schemas.public boolean isAutoEncodeSchema()
true
if the schema is automatically encoded when a model is encoded, false
otherwise.true
if the schema is automatically encoded when a model is encoded, false
otherwise.public void setAutoEncodeSchema(boolean aAutoEncodeSchema)
true
, this means that two output streams will be created when the save
or
export
method is called, one for the destination file and one for the schema.aAutoEncodeSchema
- whether a schema is to be encoded automatically when a model is
encoded.protected String createSchemaLocation(String aNamespaceURI, String aDefaultSchemaLocation, String aDestinationName)
aNamespaceURI
- the namespace URI for which to create a schema location.aDefaultSchemaLocation
- the default schema location, if known by the encoder.aDestinationName
- the name of the document being saved or exported, which will refer
in its "xsi:schemaLocations" attribute to this schema location.public boolean canExport(ILcdModel aModel, String aDestinationName)
ILcdModelEncoder
aModel
- the model to be verified.aDestinationName
- 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 aDestinationName) throws IOException
ILcdModelEncoder
aModel
- the model to be exported.aDestinationName
- 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.IOException
- if an I/O error occurs during encoding.public void export(ILcdModel aModel, Result aDestination) throws IOException
Exports the given model to a destination result.
export
in class ALcdXMLModelEncoder
aModel
- the model to exportaDestination
- the destinationIOException
- if an I/O error occurs during encoding.UnsupportedOperationException
- in case the encoder is not able to write to
the given resultILcdModelEncoder.export(ILcdModel, String)
public void exportSchema(ILcdModel aModel, String aDestinationName) throws IOException
aModel
- the model for which to generate and export an XML Schema.aDestinationName
- the destination to which the XML schema should be saved.IOException
- if an exception occurs during exporting.public ILcdModelReferenceFormatter getModelReferenceFormatter()
ILcdModelReference
instances when encoding an srsName.public void setModelReferenceFormatter(ILcdModelReferenceFormatter aModelReferenceFormatter)
ILcdModelReference
instances
when encoding an srsName.aModelReferenceFormatter
- the model reference formatter for this encoder