Package com.luciad.format.nvg.nvg20.xml
Class TLcdNVG20ModelEncoder
java.lang.Object
com.luciad.format.xml.bind.schema.ALcdXMLModelEncoder
com.luciad.format.nvg.nvg20.xml.TLcdNVG20ModelEncoder
- All Implemented Interfaces:
ILcdOutputStreamFactoryCapable
,ILcdModelEncoder
,Serializable
@LcdService(service=ILcdModelEncoder.class,
priority=20000)
public class TLcdNVG20ModelEncoder
extends ALcdXMLModelEncoder
Model encoder for creating an NVG 2.0 document from a given
TLcdNVG20Model
or TLcdNVG20FilteredModel
.
This encoder only supports NVG 2.0 models.
Output files
File | Description |
---|---|
*.xml, *.nvg | NVG XML file |
Supported file transfer protocols
- This model encoder supports all transfer protocols that are supported by
the
outputStreamFactory
of this encoder.
Supported models
- This model encoder can save and export NVG 2.0 models as described by the
TLcdNVGModelDecoder
. These models are instances ofTLcdNVG20Model
orTLcdNVG20FilteredModel
.
Sample code
ILcdModelEncoder encoder = new TLcdNVG20ModelEncoder();
encoder.export(nvgModel, "file.nvg");
Thread safety
- The encoding of models is thread-safe, as long as no properties are changed during the encoding.
Supported versions and specifications
- NATO Vector Graphics Data Format 2.0
- Since:
- 2015.0
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Returns whether this encoder can export the specified model to the specified destination.boolean
Returns whether this model encoder can save the specified model to the location it originally came from.void
Exports the specified model to the specified destination.Returns a short, displayable name for the format thisILcdModelEncoder
encodes to.Returns theorg.xml.sax.ext.EntityResolver2
that is used for creating input sources for XSD schemas.Returns theILcdOutputStreamFactory
that is used for creating output streams.Returns thejavax.xml.stream.XMLOutputFactory
that is used by this encoder for creatingjavax.xml.stream.XMLStreamWriter
instances.void
Saves the model to the location where it originally came from.void
setEntityResolver
(EntityResolver2 aEntityResolver) Sets theorg.xml.sax.ext.EntityResolver2
to be used for creating input sources for XSD schemas.void
setOutputStreamFactory
(ILcdOutputStreamFactory aOutputStreamFactory) Sets theILcdOutputStreamFactory
to be used for creating output streams.void
setXMLOutputFactory
(XMLOutputFactory aXMLOutputFactory) Sets thejavax.xml.stream.XMLOutputFactory
to be used by this encoder for creatingjavax.xml.stream.XMLStreamWriter
instances.Methods inherited from class com.luciad.format.xml.bind.schema.ALcdXMLModelEncoder
export
-
Constructor Details
-
TLcdNVG20ModelEncoder
public TLcdNVG20ModelEncoder()Creates a newTLcdNVG20ModelEncoder
, ready to use.
-
-
Method Details
-
getDisplayName
Description copied from interface:ILcdModelEncoder
Returns a short, displayable name for the format thisILcdModelEncoder
encodes to.- Returns:
- the displayable name of this
ILcdModelEncoder
.
-
canSave
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.- 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
Description copied from interface:ILcdModelEncoder
Saves the model to the location where it originally came from.- 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
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.- Parameters:
aModel
- the model to be verified.aDestinationName
- 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 aDestinationName) throws IllegalArgumentException, IOException Description copied from interface:ILcdModelEncoder
Exports the specified model to the specified destination.- Parameters:
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.- Throws:
IllegalArgumentException
- if the model cannot be saved by this encoder (!canExport(aModel, aDestinationName)
).IOException
- if an I/O error occurs during encoding.
-
getOutputStreamFactory
Description copied from class:ALcdXMLModelEncoder
Returns theILcdOutputStreamFactory
that is used for creating output streams.- Specified by:
getOutputStreamFactory
in interfaceILcdOutputStreamFactoryCapable
- Specified by:
getOutputStreamFactory
in classALcdXMLModelEncoder
- Returns:
- the
ILcdOutputStreamFactory
that is used for creating output streams. - See Also:
-
setOutputStreamFactory
Description copied from class:ALcdXMLModelEncoder
Sets theILcdOutputStreamFactory
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.- Specified by:
setOutputStreamFactory
in interfaceILcdOutputStreamFactoryCapable
- Specified by:
setOutputStreamFactory
in classALcdXMLModelEncoder
- Parameters:
aOutputStreamFactory
- the output stream factory to be used by this model encoder.- See Also:
-
getXMLOutputFactory
Description copied from class:ALcdXMLModelEncoder
Returns thejavax.xml.stream.XMLOutputFactory
that is used by this encoder for creatingjavax.xml.stream.XMLStreamWriter
instances.- Specified by:
getXMLOutputFactory
in classALcdXMLModelEncoder
- Returns:
- the
javax.xml.stream.XMLOutputFactory
that is used by this encoder for creatingjavax.xml.stream.XMLStreamWriter
instances.
-
setXMLOutputFactory
Description copied from class:ALcdXMLModelEncoder
Sets thejavax.xml.stream.XMLOutputFactory
to be used by this encoder for creatingjavax.xml.stream.XMLStreamWriter
instances.- Specified by:
setXMLOutputFactory
in classALcdXMLModelEncoder
- Parameters:
aXMLOutputFactory
- thejavax.xml.stream.XMLOutputFactory
to be used by this encoder for creatingjavax.xml.stream.XMLStreamWriter
instances.
-
getEntityResolver
Description copied from class:ALcdXMLModelEncoder
Returns theorg.xml.sax.ext.EntityResolver2
that is used for creating input sources for XSD schemas.- Specified by:
getEntityResolver
in classALcdXMLModelEncoder
- Returns:
- the entity resolver to be used for creating input sources for XSD schemas.
-
setEntityResolver
Description copied from class:ALcdXMLModelEncoder
Sets theorg.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.- Specified by:
setEntityResolver
in classALcdXMLModelEncoder
- Parameters:
aEntityResolver
- the entity resolver to be used for creating input sources for XSD schemas.
-