Class TLcdWFSModelEncoder

java.lang.Object
com.luciad.ogc.wfs.TLcdWFSModelEncoder
All Implemented Interfaces:
ILcdModelEncoder, ILcdWFSModelEncoder, Serializable

public class TLcdWFSModelEncoder extends Object implements ILcdWFSModelEncoder
This class allows you to define a WFS output format by combining an ILcdModelEncoder with a content type (MIME type). The content type will be used for the HTTP response. You can use null to indicate 'unspecified content type', but it is recommended to specify a content type since it allows clients to make smarter decisions.
Since:
2015.0
See Also:
  • Constructor Summary

    Constructors
    Constructor
    Description
    TLcdWFSModelEncoder(ILcdModelEncoder aDelegate, String aContentType)
    Constructs an instance of this class from a given ILcdModelEncoder and content type.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    canExport(ILcdModel aModel, String aDestinationName)
    Returns whether this encoder can export the specified model to the specified destination.
    boolean
    Returns whether this model encoder can save the specified model to the location it originally came from.
    boolean
    equals(Object aObject)
     
    void
    export(ILcdModel aModel, String aDestinationName)
    Exports the specified model to the specified destination.
    Gets the content type (MIME type) of the encoded schema that will be used for the HTTP response to a WFS GetFeature request.
    Returns a short, displayable name for the format this ILcdModelEncoder encodes to.
    int
     
    void
    save(ILcdModel aModel)
    Saves the model to the location where it originally came from.
     

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • TLcdWFSModelEncoder

      public TLcdWFSModelEncoder(ILcdModelEncoder aDelegate, String aContentType)
      Constructs an instance of this class from a given ILcdModelEncoder and content type. The content type may be null to indicate 'unspecified content type', but it is recommended to specify a content type.
      Parameters:
      aDelegate - a delegate model encoder, must not be null
      aContentType - a content type (MIME type), which may be null to indicate 'unspecified content type'
  • Method Details

    • getContentType

      public String getContentType()
      Description copied from interface: ILcdWFSModelEncoder
      Gets the content type (MIME type) of the encoded schema that will be used for the HTTP response to a WFS GetFeature request. When the content type is null, the content type is undefined and no content type will be set on the response. It is recommended to always explicitly define a content type because browsers and clients often depend on it for correct and well-defined behavior.

      A typical content type is "text/xml; subtype=gml/3.1.1" for GML 3.1.

      Specified by:
      getContentType in interface ILcdWFSModelEncoder
      Returns:
      the content type (MIME type) of the encoded model, which may be null
    • getDisplayName

      public String getDisplayName()
      Description copied from interface: ILcdModelEncoder
      Returns a short, displayable name for the format this ILcdModelEncoder encodes to.
      Specified by:
      getDisplayName in interface ILcdModelEncoder
      Returns:
      the displayable name of this ILcdModelEncoder.
    • canSave

      public boolean canSave(ILcdModel aModel)
      Description copied from interface: ILcdModelEncoder
      Returns whether this model encoder can save the specified model to the location it originally came from. Often this will only be a simple test, for example checking the type of the model's model descriptor.
      Specified by:
      canSave in interface ILcdModelEncoder
      Parameters:
      aModel - the model to be verified.
      Returns:
      true if this encoder can save the model in the location where it originally came from, false otherwise.
      See Also:
    • save

      public void save(ILcdModel aModel) throws IllegalArgumentException, IOException
      Description copied from interface: ILcdModelEncoder
      Saves the model to the location where it originally came from.
      Specified by:
      save in interface ILcdModelEncoder
      Parameters:
      aModel - the model to be saved.
      Throws:
      IllegalArgumentException - if the model cannot be saved by this encoder (!canSave(aModel)).
      IOException - if an I/O error occurs during encoding.
    • canExport

      public boolean canExport(ILcdModel aModel, String aDestinationName)
      Description copied from interface: ILcdModelEncoder
      Returns whether this encoder can export the specified model to the specified destination. This method will typically check whether the contents of the specified model are compatible with the format this encoder is written for.
      Specified by:
      canExport in interface ILcdModelEncoder
      Parameters:
      aModel - the model to be verified.
      aDestinationName - the location where the model should be exported to.
      Returns:
      true if this encoder can export the specified model to the specified location, false otherwise.
      See Also:
    • export

      public void export(ILcdModel aModel, String aDestinationName) throws IllegalArgumentException, IOException
      Description copied from interface: ILcdModelEncoder
      Exports the specified model to the specified destination.
      Specified by:
      export in interface ILcdModelEncoder
      Parameters:
      aModel - the model to be exported.
      aDestinationName - the location where the model should be saved. Typically, this is a name for the output file, but it can also point to a file containing the required properties to create a set of data files.
      Throws:
      IllegalArgumentException - if the model cannot be saved by this encoder (!canExport(aModel, aDestinationName)).
      IOException - if an I/O error occurs during encoding.
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object aObject)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object