Class TLcdCSWDecoder

java.lang.Object
com.luciad.ogc.csw.xml.TLcdCSWDecoder
All Implemented Interfaces:
ILcdInputStreamFactoryCapable

public class TLcdCSWDecoder extends Object implements 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 Details

    • TLcdCSWDecoder

      public TLcdCSWDecoder()
  • Method Details

    • getInputStreamFactory

      public ILcdInputStreamFactory getInputStreamFactory()
      Returns the ILcdInputStreamFactory that is used for creating input streams.
      Specified by:
      getInputStreamFactory in interface ILcdInputStreamFactoryCapable
      Returns:
      the ILcdInputStreamFactory that is used for creating input streams.
    • setInputStreamFactory

      public void setInputStreamFactory(ILcdInputStreamFactory aInputStreamFactory)
      Sets the ILcdInputStreamFactory to be used for creating input streams.
      Specified by:
      setInputStreamFactory in interface ILcdInputStreamFactoryCapable
      Parameters:
      aInputStreamFactory - the input stream factory to be used by this model decoder.
    • setEntityResolver

      public void setEntityResolver(EntityResolver2 aEntityResolver)

      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 returns null), the getInputStreamFactory() 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

      public TLcdCSWRecord decodeRecord(String aSourcePath) throws IOException
      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 a Record. For all other data sources, use decodeObject(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

      public TLcdCSWRecord decodeRecord(Source aSource) throws IOException
      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 a Record. For all other data sources, use decodeObject(String).

      You can decode an input stream by wrapping it into a StreamSource.

      Parameters:
      aSource - the data source to be decoded; typically a StreamSource
      Returns:
      a TLcdCSWRecord object representing the decoded metadata.
      Throws:
      IOException - for any exceptions caused by IO problems or invalid data.
      See Also:
    • decodeObject

      public ILcdDataObject decodeObject(String aSourcePath) throws IOException
      Decodes an OGC catalog domain object from the given XML file. The returned object is an ILcdDataObject whose instance class corresponds to the XML root element in the data source. This instance class may be any class in the com.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

      public ILcdDataObject decodeObject(Source aSource) throws IOException
      Decodes an OGC catalog domain object from the given XML source. The returned object is an ILcdDataObject whose instance class corresponds to the XML root element in the data source. This instance class may be any class in the com.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 a StreamSource
      Returns:
      an ILcdDataObject representing the decoded metadata.
      Throws:
      IOException - for any exceptions caused by IO problems or invalid data.