Class ALcdXMLModelDecoder
- All Implemented Interfaces:
ILcdInputStreamFactoryCapable
,ILcdModelDecoder
- Direct Known Subclasses:
TLcdAIXM51ModelDecoder
,TLcdGML2ModelDecoder
,TLcdGML31ModelDecoder
,TLcdGML32ModelDecoder
,TLcdGMLModelDecoder
,TLcdKML22ModelDecoder
,TLcdNVGModelDecoder
ILcdModelDecoder
that provides additional infrastructure
to decode XML schema based documents.- Since:
- 10.0
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionCreates a new model from the given data source.abstract EntityResolver2
Returns theorg.xml.sax.ext.EntityResolver2
that is used for creating input sources for XSD schemas.abstract ILcdInputStreamFactory
Returns theILcdInputStreamFactory
that is used for creating input streams.abstract XMLInputFactory
Returns thejavax.xml.stream.XMLInputFactory
that is used by this decoder for creatingjavax.xml.stream.XMLStreamReader
instances.abstract boolean
Returns if application schemas are cached.abstract void
setEntityResolver
(EntityResolver2 aEntityResolver) Sets theorg.xml.sax.ext.EntityResolver2
to be used for creating input sources for XSD schemas.abstract void
setInputStreamFactory
(ILcdInputStreamFactory aInputStreamFactory) Sets theILcdInputStreamFactory
to be used for creating input streams.abstract void
setUseApplicationSchemaCache
(boolean aUseCache) Enables or disables application schema caching depending on the parameter value.abstract void
setXMLInputFactory
(XMLInputFactory aXMLInputFactory) Sets thejavax.xml.stream.XMLInputFactory
to be used by this decoder for creatingjavax.xml.stream.XMLStreamReader
instances.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.luciad.model.ILcdModelDecoder
canDecodeSource, canDecodeSource, decode, decodeModelMetadata, decodeModelMetadata, decodeSource, discoverDataSources, getDisplayName
-
Constructor Details
-
ALcdXMLModelDecoder
public ALcdXMLModelDecoder()
-
-
Method Details
-
getInputStreamFactory
Returns theILcdInputStreamFactory
that is used for creating input streams.- Specified by:
getInputStreamFactory
in interfaceILcdInputStreamFactoryCapable
- Returns:
- the
ILcdInputStreamFactory
that is used for creating input streams. - See Also:
-
setInputStreamFactory
Sets theILcdInputStreamFactory
to be used for creating input streams. If the configuredentity resolver
implementsILcdInputStreamFactoryCapable
, it is also configured with this factory.- Specified by:
setInputStreamFactory
in interfaceILcdInputStreamFactoryCapable
- Parameters:
aInputStreamFactory
- the input stream factory to be used by this model decoder.- See Also:
-
getXMLInputFactory
Returns thejavax.xml.stream.XMLInputFactory
that is used by this decoder for creatingjavax.xml.stream.XMLStreamReader
instances.- Returns:
- the
javax.xml.stream.XMLInputFactory
that is used by this decoder for creatingjavax.xml.stream.XMLStreamReader
instances.
-
setXMLInputFactory
Sets thejavax.xml.stream.XMLInputFactory
to be used by this decoder for creatingjavax.xml.stream.XMLStreamReader
instances.- Parameters:
aXMLInputFactory
- thejavax.xml.stream.XMLInputFactory
to be used by this decoder for creatingjavax.xml.stream.XMLStreamReader
instances.
-
getEntityResolver
Returns theorg.xml.sax.ext.EntityResolver2
that is used for creating input sources for XSD schemas. This entity resolver will only be used to resolve extension schemas that are not already configured on this decoder.- Returns:
- the entity resolver to be used for creating input sources for XSD schemas.
-
setEntityResolver
Sets the
org.xml.sax.ext.EntityResolver2
to be used for creating input sources for XSD schemas.When the entity resolver is unable to find a schema (i.e. the
resolveEntity
method returnsnull
), thegetInputStreamFactory()
is used to create an appropriate input stream for the given system id of the schema.- Parameters:
aEntityResolver
- the entity resolver to be used for creating input sources for XSD schemas.
-
isUseApplicationSchemaCache
public abstract boolean isUseApplicationSchemaCache()Returns if application schemas are cached. When application schemas are cached, the decoder 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 not to cache.
Note that in case multiple application schemas use the same namespace URI, it is not possible to turn on application schema caching because the decoder will not be able to discern between the different schemas.
- Returns:
- if application schemas are cached
-
setUseApplicationSchemaCache
public abstract void setUseApplicationSchemaCache(boolean aUseCache) Enables or disables application schema caching depending on the parameter value.- Parameters:
aUseCache
- if true, application schema caching is turned on. If false, caching is turned off.
-
decode
Creates a new model from the given data source.
Note that the default implementation throws
UnsupportedOperationException
. Extensions from this class should provide a more appropriate implementation.- Parameters:
aSource
- the source to read the model from- Throws:
UnsupportedOperationException
- in case the decoder is not able to decode from the sourceIOException
- See Also:
-