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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionCreates a new model from the given data source.abstract EntityResolver2Returns theorg.xml.sax.ext.EntityResolver2that is used for creating input sources for XSD schemas.abstract ILcdInputStreamFactoryReturns theILcdInputStreamFactorythat is used for creating input streams.abstract XMLInputFactoryReturns thejavax.xml.stream.XMLInputFactorythat is used by this decoder for creatingjavax.xml.stream.XMLStreamReaderinstances.abstract booleanReturns if application schemas are cached.abstract voidsetEntityResolver(EntityResolver2 aEntityResolver) Sets theorg.xml.sax.ext.EntityResolver2to be used for creating input sources for XSD schemas.abstract voidsetInputStreamFactory(ILcdInputStreamFactory aInputStreamFactory) Sets theILcdInputStreamFactoryto be used for creating input streams.abstract voidsetUseApplicationSchemaCache(boolean aUseCache) Enables or disables application schema caching depending on the parameter value.abstract voidsetXMLInputFactory(XMLInputFactory aXMLInputFactory) Sets thejavax.xml.stream.XMLInputFactoryto be used by this decoder for creatingjavax.xml.stream.XMLStreamReaderinstances.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.luciad.model.ILcdModelDecoder
canDecodeSource, canDecodeSource, decode, decodeModelMetadata, decodeModelMetadata, decodeSource, discoverDataSources, getDisplayName
-
Constructor Details
-
ALcdXMLModelDecoder
public ALcdXMLModelDecoder()
-
-
Method Details
-
getInputStreamFactory
Returns theILcdInputStreamFactorythat is used for creating input streams.- Specified by:
getInputStreamFactoryin interfaceILcdInputStreamFactoryCapable- Returns:
- the
ILcdInputStreamFactorythat is used for creating input streams. - See Also:
-
setInputStreamFactory
Sets theILcdInputStreamFactoryto be used for creating input streams. If the configuredentity resolverimplementsILcdInputStreamFactoryCapable, it is also configured with this factory.- Specified by:
setInputStreamFactoryin interfaceILcdInputStreamFactoryCapable- Parameters:
aInputStreamFactory- the input stream factory to be used by this model decoder.- See Also:
-
getXMLInputFactory
Returns thejavax.xml.stream.XMLInputFactorythat is used by this decoder for creatingjavax.xml.stream.XMLStreamReaderinstances.- Returns:
- the
javax.xml.stream.XMLInputFactorythat is used by this decoder for creatingjavax.xml.stream.XMLStreamReaderinstances.
-
setXMLInputFactory
Sets thejavax.xml.stream.XMLInputFactoryto be used by this decoder for creatingjavax.xml.stream.XMLStreamReaderinstances.- Parameters:
aXMLInputFactory- thejavax.xml.stream.XMLInputFactoryto be used by this decoder for creatingjavax.xml.stream.XMLStreamReaderinstances.
-
getEntityResolver
Returns theorg.xml.sax.ext.EntityResolver2that 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.EntityResolver2to be used for creating input sources for XSD schemas.When the entity resolver is unable to find a schema (i.e. the
resolveEntitymethod 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:
-