public class TLcdISO19139MetadataEncoder extends Object implements ILcdOutputStreamFactoryCapable
model
package.
This encoder can encode any instance of classes in the metadata domain model.
TLcdXMLDataModelBuilder dataModelBuilder = new TLcdXMLDataModelBuilder( TLcdISO19115DataTypes.getDataModel() ); dataModelBuilder.setEntityResolver( new TLcdXMLEntityResolver() ); TLcdDataModel dataModel = dataModelBuilder.createDataModel( "http://myextensionnamespace.com", "http://myextensionnamespace.com", "/myextensionschemalocation.xsd" ); TLcdISO19139MetadataEncoder encoder = new TLcdISO19139MetadataEncoder( dataModel );
TLcdISO19115Metadata
,
TLcdISO19139MetadataDecoder
,
com.luciad.format.metadata.model
Constructor and Description |
---|
TLcdISO19139MetadataEncoder()
Creates a new
TLcdISO19139MetadataEncoder instance. |
TLcdISO19139MetadataEncoder(TLcdDataModel aDataModel)
Creates a new
TLcdISO19139MetadataEncoder instance, configured for encoding the
given ISO19115 extension. |
Modifier and Type | Method and Description |
---|---|
void |
encodeMetadata(TLcdISO19115Metadata aMetadata,
String aDestination)
Encodes an ISO 19115 metadata domain object to an ISO 19139 data source.
|
void |
encodeObject(ILcdDataObject aMetadataObject,
String aDestination)
Encodes an ISO 19115 domain object to an ISO 19139 data source.
|
EntityResolver2 |
getEntityResolver()
Returns the
org.xml.sax.ext.EntityResolver2 that is used for creating input sources for
XSD schemas. |
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 |
isUseApplicationSchemaCache()
Returns if application schemas are cached.
|
void |
setEntityResolver(EntityResolver2 aEntityResolver)
Sets the
org.xml.sax.ext.EntityResolver2 to be used for creating input sources for XSD
schemas. |
void |
setOutputStreamFactory(ILcdOutputStreamFactory aOutputStreamFactory)
Sets the
ILcdOutputStreamFactory to be used for creating output streams. |
void |
setUseApplicationSchemaCache(boolean aUseCache)
Enables or disables application schema caching depending on the parameter value.
|
void |
setXMLOutputFactory(XMLOutputFactory aXMLOutputFactory)
Sets the
javax.xml.stream.XMLOutputFactory to be used by this encoder for creating
javax.xml.stream.XMLStreamWriter instances. |
public TLcdISO19139MetadataEncoder()
TLcdISO19139MetadataEncoder
instance. This encoder is configured
for encoding any data type in the ISO19115 data model.com.luciad.format.metadata.model
public TLcdISO19139MetadataEncoder(TLcdDataModel aDataModel)
TLcdISO19139MetadataEncoder
instance, configured for encoding the
given ISO19115 extension.
The initialized encoder also supports all data types in the ISO19115 data model.aDataModel
- a data model representing an ISO191115 extension. The data model should be
built from an XML schema using TLcdXMLDataModelBuilder, and should depend
on the ISO19115 data model.com.luciad.format.metadata.model
public ILcdOutputStreamFactory getOutputStreamFactory()
ILcdOutputStreamFactory
that is used for creating output streams.getOutputStreamFactory
in interface ILcdOutputStreamFactoryCapable
ILcdOutputStreamFactory
that is used for creating output streams.setOutputStreamFactory(com.luciad.io.ILcdOutputStreamFactory)
public void setOutputStreamFactory(ILcdOutputStreamFactory aOutputStreamFactory)
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
aOutputStreamFactory
- the output stream factory to be used by this model encoder.setOutputStreamFactory(com.luciad.io.ILcdOutputStreamFactory)
public XMLOutputFactory getXMLOutputFactory()
javax.xml.stream.XMLOutputFactory
that is used by this encoder for creating
javax.xml.stream.XMLStreamWriter
instances.javax.xml.stream.XMLOutputFactory
that is used by this encoder for creating
javax.xml.stream.XMLStreamWriter
instances.public void setXMLOutputFactory(XMLOutputFactory aXMLOutputFactory)
javax.xml.stream.XMLOutputFactory
to be used by this encoder for creating
javax.xml.stream.XMLStreamWriter
instances.aXMLOutputFactory
- the javax.xml.stream.XMLOutputFactory
to be used by this encoder
for creating javax.xml.stream.XMLStreamWriter
instances.public EntityResolver2 getEntityResolver()
org.xml.sax.ext.EntityResolver2
that is used for creating input sources for
XSD schemas.public void setEntityResolver(EntityResolver2 aEntityResolver)
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.aEntityResolver
- the entity resolver to be used for creating input sources for XSD
schemas.public boolean isUseApplicationSchemaCache()
Returns if application schemas are cached. When application schemas are cached,
the encoder caches all applications schemas it encounters. When a certain schema
is referenced during decoding, only if the schema is not found in the cache,
it will be resolved. The default is true
.
Note that in case multiple application schemas use the same namespace URI, it is not possible to turn on application schema caching because the encoder will not be able to discern between the different schemas.
public void setUseApplicationSchemaCache(boolean aUseCache)
aUseCache
- if true, application schema caching is turned on. If false,
caching is turned off.public void encodeMetadata(TLcdISO19115Metadata aMetadata, String aDestination) throws IOException
aMetadata
- the ISO 19115 metadata domain object to be encoded.aDestination
- the location where the ISO 19139 data should be saved.IOException
- if an I/O error occurs during encoding.public void encodeObject(ILcdDataObject aMetadataObject, String aDestination) throws IOException
com.luciad.format.metadata.model
package or any of its subpackages.aMetadataObject
- the ISO 19115 metadata domain object to be encoded.aDestination
- the location where the ISO 19139 data should be saved.IOException
- if an I/O error occurs during encoding.