Class GeometryEncoder<T extends Geometry>

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected void addGmlId​(AttributesImpl attributes, String gmlId)
      Adds a gmlId to an existing and non null attribute set
      protected AttributesImpl cloneWithGmlId​(AttributesImpl atts, String gmlId)
      Returns a new AttributesImpl based on the provided on, with the addition of a gml:id attribute
      void encode​(T geometry, AttributesImpl atts, GMLWriter handler)
      Encodes a geometry value
      void encode​(T geometry, AttributesImpl atts, GMLWriter handler, String gmlId)
      Encodes a geometry value with a given gmlId (implementations might choose to use it to generate gml:id attributes, depending on the GML version.
      • Methods inherited from class Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • GeometryEncoder

        protected GeometryEncoder​(Encoder encoder)
      • GeometryEncoder

        protected GeometryEncoder​(Encoder encoder,
                                  boolean encodeGmlId)
    • Method Detail

      • encode

        public void encode​(T geometry,
                           AttributesImpl atts,
                           GMLWriter handler,
                           String gmlId)
                    throws Exception
        Encodes a geometry value with a given gmlId (implementations might choose to use it to generate gml:id attributes, depending on the GML version. The default implementation does not use gmlId and simply delegates to encode(Geometry, AttributesImpl, GMLWriter)
        Parameters:
        geometry - The Geometry to be encoded
        atts - Its attributes
        handler - The handler used to write XML
        gmlId - If not null, some implementation will use to as the gml:id (and to build ids for the nested features)
        Throws:
        Exception
      • cloneWithGmlId

        protected AttributesImpl cloneWithGmlId​(AttributesImpl atts,
                                                String gmlId)
        Returns a new AttributesImpl based on the provided on, with the addition of a gml:id attribute
        Parameters:
        atts - The base attributes (can be null)
        gmlId - The desired gml:id value
        Returns:
        The provided atts object if gmlId is null, a clone of the provided one plus the gml:id attribute otherwise
      • addGmlId

        protected void addGmlId​(AttributesImpl attributes,
                                String gmlId)
        Adds a gmlId to an existing and non null attribute set
      • encode

        public void encode​(T geometry,
                           AttributesImpl atts,
                           GMLWriter handler)
                    throws Exception
        Encodes a geometry value
        Specified by:
        encode in class ObjectEncoder<T extends Geometry>
        Parameters:
        geometry - The Geometry to be encoded
        atts - Its attributes
        handler - The handler used to write XML
        Throws:
        Exception