Package com.luciad.format.nvg.nvg15.xml
Class TLcdNVG15ModelEncoder
java.lang.Object
com.luciad.format.xml.bind.schema.ALcdXMLModelEncoder
com.luciad.format.nvg.nvg15.xml.TLcdNVG15ModelEncoder
- All Implemented Interfaces:
ILcdOutputStreamFactoryCapable,ILcdModelEncoder,Serializable
@LcdService(service=ILcdModelEncoder.class,
priority=20000)
public class TLcdNVG15ModelEncoder
extends ALcdXMLModelEncoder
Model encoder for creating an NVG 1.5 document from a given
TLcdNVG15Model.
This encoder only supports NVG 1.5 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
outputStreamFactoryof this encoder.
Supported models
- This model encoder can save and export NVG 1.4/1.5 models as described by the
TLcdNVGModelDecoder. These models are instances ofTLcdNVG15Model.
Sample code
ILcdModelEncoder encoder = new TLcdNVG15ModelEncoder();
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 1.4
- NATO Vector Graphics Data Format 1.5
- Since:
- 2015.0
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns whether this encoder can export the specified model to the specified destination.booleanReturns whether this model encoder can save the specified model to the location it originally came from.voidExports the specified model to the specified destination.Returns a short, displayable name for the format thisILcdModelEncoderencodes to.Returns theorg.xml.sax.ext.EntityResolver2that is used for creating input sources for XSD schemas.Returns theILcdOutputStreamFactorythat is used for creating output streams.Returns thejavax.xml.stream.XMLOutputFactorythat is used by this encoder for creatingjavax.xml.stream.XMLStreamWriterinstances.voidSaves the model to the location where it originally came from.voidsetEntityResolver(EntityResolver2 aEntityResolver) Sets theorg.xml.sax.ext.EntityResolver2to be used for creating input sources for XSD schemas.voidsetOutputStreamFactory(ILcdOutputStreamFactory aOutputStreamFactory) Sets theILcdOutputStreamFactoryto be used for creating output streams.voidsetXMLOutputFactory(XMLOutputFactory aXMLOutputFactory) Sets thejavax.xml.stream.XMLOutputFactoryto be used by this encoder for creatingjavax.xml.stream.XMLStreamWriterinstances.Methods inherited from class com.luciad.format.xml.bind.schema.ALcdXMLModelEncoder
export
-
Constructor Details
-
TLcdNVG15ModelEncoder
public TLcdNVG15ModelEncoder()Creates a newTLcdNVG15ModelEncoder, ready to use.
-
-
Method Details
-
getDisplayName
Description copied from interface:ILcdModelEncoderReturns a short, displayable name for the format thisILcdModelEncoderencodes to.- Returns:
- the displayable name of this
ILcdModelEncoder.
-
canSave
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.- 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
Description copied from interface:ILcdModelEncoderSaves 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: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.- Parameters:
aModel- the model to be verified.aDestinationName- 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 aDestinationName) throws IllegalArgumentException, IOException Description copied from interface:ILcdModelEncoderExports 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:ALcdXMLModelEncoderReturns theILcdOutputStreamFactorythat is used for creating output streams.- Specified by:
getOutputStreamFactoryin interfaceILcdOutputStreamFactoryCapable- Specified by:
getOutputStreamFactoryin classALcdXMLModelEncoder- Returns:
- the
ILcdOutputStreamFactorythat is used for creating output streams. - See Also:
-
setOutputStreamFactory
Description copied from class:ALcdXMLModelEncoderSets theILcdOutputStreamFactoryto 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:
setOutputStreamFactoryin interfaceILcdOutputStreamFactoryCapable- Specified by:
setOutputStreamFactoryin classALcdXMLModelEncoder- Parameters:
aOutputStreamFactory- the output stream factory to be used by this model encoder.- See Also:
-
getXMLOutputFactory
Description copied from class:ALcdXMLModelEncoderReturns thejavax.xml.stream.XMLOutputFactorythat is used by this encoder for creatingjavax.xml.stream.XMLStreamWriterinstances.- Specified by:
getXMLOutputFactoryin classALcdXMLModelEncoder- Returns:
- the
javax.xml.stream.XMLOutputFactorythat is used by this encoder for creatingjavax.xml.stream.XMLStreamWriterinstances.
-
setXMLOutputFactory
Description copied from class:ALcdXMLModelEncoderSets thejavax.xml.stream.XMLOutputFactoryto be used by this encoder for creatingjavax.xml.stream.XMLStreamWriterinstances.- Specified by:
setXMLOutputFactoryin classALcdXMLModelEncoder- Parameters:
aXMLOutputFactory- thejavax.xml.stream.XMLOutputFactoryto be used by this encoder for creatingjavax.xml.stream.XMLStreamWriterinstances.
-
getEntityResolver
Description copied from class:ALcdXMLModelEncoderReturns theorg.xml.sax.ext.EntityResolver2that is used for creating input sources for XSD schemas.- Specified by:
getEntityResolverin classALcdXMLModelEncoder- Returns:
- the entity resolver to be used for creating input sources for XSD schemas.
-
setEntityResolver
Description copied from class:ALcdXMLModelEncoderSets theorg.xml.sax.ext.EntityResolver2to be used for creating input sources for XSD schemas. This entity resolver is only used for retrieving runtime extension schemas.- Specified by:
setEntityResolverin classALcdXMLModelEncoder- Parameters:
aEntityResolver- the entity resolver to be used for creating input sources for XSD schemas.
-