Class TLcdOGCFilterEncoder

java.lang.Object
com.luciad.ogc.filter.xml.TLcdOGCFilterEncoder
All Implemented Interfaces:
ILcdOutputStreamFactoryCapable

public class TLcdOGCFilterEncoder extends Object implements ILcdOutputStreamFactoryCapable
XML encoder for generating documents describing OGC filters, structured according to version 1.1.0 or 2.0 of the OGC Filter specification.
  • Constructor Details

    • TLcdOGCFilterEncoder

      public TLcdOGCFilterEncoder()
      Creates a new encoder, configured for OGC Filter 1.1.0
    • TLcdOGCFilterEncoder

      public TLcdOGCFilterEncoder(TLcdOGCFilterEncoder.Version aVersion)
      Creates a new encoder, configured for the given OGC Filter version (1.1 or 2.0).
      Parameters:
      aVersion - The version to output the filter to.
      Since:
      2017.0
  • Method Details

    • setOutputStreamFactory

      public void setOutputStreamFactory(ILcdOutputStreamFactory aOutputStreamFactory)
      Sets the output stream factory that will be used for creating output streams given source names.
      Specified by:
      setOutputStreamFactory in interface ILcdOutputStreamFactoryCapable
      Parameters:
      aOutputStreamFactory - the output stream factory to be used.
    • getOutputStreamFactory

      public ILcdOutputStreamFactory getOutputStreamFactory()
      Returns the output stream factory that is currently used for creating output streams given source names.
      Specified by:
      getOutputStreamFactory in interface ILcdOutputStreamFactoryCapable
      Returns:
      the input stream factory that is currently used.
    • encode

      public void encode(Object aFilterModelObject, String aSourceName) throws IOException
      Encodes the given filter model object to the given destination.
      Parameters:
      aFilterModelObject - the given object of the filter model
      aSourceName - the full path to the source where the object should be written.
      Throws:
      IOException - thrown if an error occurs during the write process.
    • encode

      public final void encode(Object aFilterModelObject, OutputStream aOutputStream) throws IOException
      Encodes the given filter model object to the given output stream.
      Parameters:
      aFilterModelObject - the given object of the filter model
      aOutputStream - the stream to which the output should be written
      Throws:
      IOException - thrown if an error occurs during the write process.
      Since:
      2017.0
    • encodeToString

      public static String encodeToString(TLcdOGCFilter aOGCFilter) throws IOException
      Utility method to encode the filter as an OGC Filter 2.0.0 XML string.
      Parameters:
      aOGCFilter - The filter
      Returns:
      An XML-encoded version of aOGCFilter
      Throws:
      IOException - When something goes wrong during the encoding
      Since:
      2017.0