Class ShapeAsGeoJSONSerializer

  • All Implemented Interfaces:
    com.fasterxml.jackson.databind.jsonFormatVisitors.JsonFormatVisitable

    public class ShapeAsGeoJSONSerializer
    extends com.fasterxml.jackson.databind.JsonSerializer<Shape>
    • Nested Class Summary

      • Nested classes/interfaces inherited from class com.fasterxml.jackson.databind.JsonSerializer

        com.fasterxml.jackson.databind.JsonSerializer.None
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static double round​(double v)  
      void serialize​(Shape shape, com.fasterxml.jackson.core.JsonGenerator gen, com.fasterxml.jackson.databind.SerializerProvider serializers)  
      protected void write​(com.fasterxml.jackson.core.JsonGenerator gen, double... coords)  
      void write​(com.fasterxml.jackson.core.JsonGenerator gen, Shape shape)  
      (package private) void writeDistance​(com.fasterxml.jackson.core.JsonGenerator gen, double dist, boolean isGeo, java.lang.String distProperty, java.lang.String distUnitsProperty)
      Helper method to encode a distance property (with optional unit).
      • Methods inherited from class com.fasterxml.jackson.databind.JsonSerializer

        acceptJsonFormatVisitor, getDelegatee, handledType, isEmpty, isEmpty, isUnwrappingSerializer, properties, replaceDelegatee, serializeWithType, unwrappingSerializer, usesObjectId, withFilterId, withIgnoredProperties
      • Methods inherited from class java.lang.Object

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

      • ShapeAsGeoJSONSerializer

        public ShapeAsGeoJSONSerializer()
    • Method Detail

      • write

        protected void write​(com.fasterxml.jackson.core.JsonGenerator gen,
                             double... coords)
                      throws java.io.IOException
        Throws:
        java.io.IOException
      • round

        public static double round​(double v)
      • writeDistance

        void writeDistance​(com.fasterxml.jackson.core.JsonGenerator gen,
                           double dist,
                           boolean isGeo,
                           java.lang.String distProperty,
                           java.lang.String distUnitsProperty)
                    throws java.io.IOException
        Helper method to encode a distance property (with optional unit).

        The distance unit is only encoded when isGeo is true, and it is converted to km.

        The distance unit is encoded within a properties object.

        Parameters:
        output - The writer.
        nf - The number format.
        dist - The distance value to encode.
        isGeo - The flag determining
        distProperty - The distance property name.
        distUnitsProperty - The distance unit property name.
        Throws:
        java.io.IOException
      • write

        public void write​(com.fasterxml.jackson.core.JsonGenerator gen,
                          Shape shape)
                   throws java.io.IOException
        Throws:
        java.io.IOException
      • serialize

        public void serialize​(Shape shape,
                              com.fasterxml.jackson.core.JsonGenerator gen,
                              com.fasterxml.jackson.databind.SerializerProvider serializers)
                       throws java.io.IOException,
                              com.fasterxml.jackson.core.JsonProcessingException
        Specified by:
        serialize in class com.fasterxml.jackson.databind.JsonSerializer<Shape>
        Throws:
        java.io.IOException
        com.fasterxml.jackson.core.JsonProcessingException