Package com.luciad.ogc.csw.xml
Class TLcdCSWDecoder
java.lang.Object
com.luciad.ogc.csw.xml.TLcdCSWDecoder
- All Implemented Interfaces:
ILcdInputStreamFactoryCapable
An XML decoder for OGC catalog service domain objects.
Decoding
This decoder offers 2 decoding methods:- decodeRecord: use this method to decode a source containing a single record entity (TLcdCSWRecord)
- decodeObject: use this method for all other sources (e.g. GetRecord requests)
Supported versions and specifications
This decoder supports OGC CSW version 2.0.2 and 3.0.0. For more information, see the OGC Catalog homepage.- Since:
- 2017.0
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiondecodeObject
(String aSourcePath) Decodes an OGC catalog domain object from the given XML file.decodeObject
(Source aSource) Decodes an OGC catalog domain object from the given XML source.decodeRecord
(String aSourcePath) Decodes an OGC catalog record from the given XML file.decodeRecord
(Source aSource) Decodes an OGC catalog record from the given XML source.Returns theILcdInputStreamFactory
that is used for creating input streams.void
setEntityResolver
(EntityResolver2 aEntityResolver) Sets theorg.xml.sax.ext.EntityResolver2
to be used for creating input sources for XSD schemas.void
setInputStreamFactory
(ILcdInputStreamFactory aInputStreamFactory) Sets theILcdInputStreamFactory
to be used for creating input streams.
-
Constructor Details
-
TLcdCSWDecoder
public TLcdCSWDecoder()
-
-
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.
-
setInputStreamFactory
Sets theILcdInputStreamFactory
to be used for creating input streams.- Specified by:
setInputStreamFactory
in interfaceILcdInputStreamFactoryCapable
- Parameters:
aInputStreamFactory
- the input stream factory to be used by this model decoder.
-
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.- Since:
- 2017.1
-
decodeRecord
Decodes an OGC catalog record from the given XML file. Only use this method if the given data source contains a single CSW record entity (that is, the root element of the XML is aRecord
. For all other data sources, usedecodeObject(String)
.- Parameters:
aSourcePath
- the data source to be decoded; typically a file name or a URL.- Returns:
- a
TLcdCSWRecord
object representing the decoded metadata. - Throws:
IOException
- for any exceptions caused by IO problems or invalid data.- See Also:
-
decodeRecord
Decodes an OGC catalog record from the given XML source. Only use this method if the given data source contains a single CSW record entity (that is, the root element of the XML is aRecord
. For all other data sources, usedecodeObject(String)
.You can decode an input stream by wrapping it into a
StreamSource
.- Parameters:
aSource
- the data source to be decoded; typically aStreamSource
- Returns:
- a
TLcdCSWRecord
object representing the decoded metadata. - Throws:
IOException
- for any exceptions caused by IO problems or invalid data.- See Also:
-
decodeObject
Decodes an OGC catalog domain object from the given XML file. The returned object is anILcdDataObject
whose instance class corresponds to the XML root element in the data source. This instance class may be any class in thecom.luciad.ogc.csw.model
package or its subpackages.- Parameters:
aSourcePath
- the data source to be decoded; typically a file name or a URL.- Returns:
- an
ILcdDataObject
representing the decoded metadata. - Throws:
IOException
- for any exceptions caused by IO problems or invalid data.
-
decodeObject
Decodes an OGC catalog domain object from the given XML source. The returned object is anILcdDataObject
whose instance class corresponds to the XML root element in the data source. This instance class may be any class in thecom.luciad.ogc.csw.model
package or its subpackages.You can decode an input stream by wrapping it into a
StreamSource
.- Parameters:
aSource
- the data source to be decoded; typically aStreamSource
- Returns:
- an
ILcdDataObject
representing the decoded metadata. - Throws:
IOException
- for any exceptions caused by IO problems or invalid data.
-