Class TLcdOGCFilterDecoder

java.lang.Object
com.luciad.ogc.filter.xml.TLcdOGCFilterDecoder
All Implemented Interfaces:
ILcdInputStreamFactoryCapable

public class TLcdOGCFilterDecoder extends Object implements ILcdInputStreamFactoryCapable
XML Decoder for documents describing OGC filters, structured according to version 1.1.0 and 2.0 of the OGC Filter specification.
  • Constructor Details

    • TLcdOGCFilterDecoder

      public TLcdOGCFilterDecoder()
      Creates a new TLcdOGCFilterDecoder with a default input stream factory.
  • Method Details

    • getDefaultModelReference

      public ILcdModelReference getDefaultModelReference()
      Returns the currently set default model reference.
      Returns:
      The default model reference, or null if none is set.
      See Also:
    • setDefaultModelReference

      public void setDefaultModelReference(ILcdModelReference aDefaultModelReference)
      Sets the default model reference which should be set on geometric primitives in case the objects do not contain a model reference themselves.
      Parameters:
      aDefaultModelReference - A valid model reference name, or null to reset it to the global default.
    • setInputStreamFactory

      public void setInputStreamFactory(ILcdInputStreamFactory aInputStreamFactory)
      Sets the input stream factory that will be used for creating input streams given source names.
      Specified by:
      setInputStreamFactory in interface ILcdInputStreamFactoryCapable
      Parameters:
      aInputStreamFactory - the input stream factory to be used.
    • getInputStreamFactory

      public ILcdInputStreamFactory getInputStreamFactory()
      Returns the input stream factory that is currently used for creating input streams given source names.
      Specified by:
      getInputStreamFactory in interface ILcdInputStreamFactoryCapable
      Returns:
      the input stream factory that is currently used.
    • decode

      public Object decode(String aSourceName) throws IOException
      Processes the given XML source document, and returns the filter model object that corresponds to the root element.
      Parameters:
      aSourceName - the full path to the file to be decoded, including the file name.
      Returns:
      the model object that corresponds to the root element.
      Throws:
      IOException - thrown if an error occurs during the read process.
    • decode

      public final Object decode(InputStream aInputStream) throws IOException
      Processes the given input stream of an XML source document, and returns the model object that corresponds to the root element.
      Parameters:
      aInputStream - the input stream
      Returns:
      the model object that corresponds to the root element.
      Throws:
      IOException - thrown if an error occurs during the read process.
      Since:
      2017.0
    • decodeFromString

      public static TLcdOGCFilter decodeFromString(String aFilterXMLString) throws IOException
      Utility method to parse a string representing an OGC filter in XML to a TLcdOGCFilter instance.
      Parameters:
      aFilterXMLString - The OGC filter as XML string
      Returns:
      the parsed version of aFilterXMLString
      Throws:
      IOException - When something goes wrong during the decoding
      Since:
      2017.0