Class FormatNumberSerializer

  • All Implemented Interfaces:
    com.fasterxml.jackson.databind.jsonFormatVisitors.JsonFormatVisitable , com.fasterxml.jackson.databind.jsonschema.SchemaAware , com.fasterxml.jackson.databind.ser.ContextualSerializer , java.io.Serializable

    
    public class FormatNumberSerializer
    extends NumberSerializer
                        

    Directly use JsonFormat and DecimalFormat to format numbers

    Since:

    2021-07-06

    Author:

    trydofor

    • Field Summary

      Fields 
      Modifier and Type Field Description
      public final static NumberSerializer instance
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      JsonSerializer<out Object> createContextual(SerializerProvider prov, BeanProperty property)
      void serialize(Number value, JsonGenerator g, SerializerProvider provider)
      • Methods inherited from class com.fasterxml.jackson.databind.ser.std.NumberSerializer

        acceptJsonFormatVisitor, bigDecimalAsStringSerializer, getSchema
      • Methods inherited from class com.fasterxml.jackson.databind.ser.std.StdScalarSerializer

        serializeWithType
      • Methods inherited from class com.fasterxml.jackson.databind.ser.std.StdSerializer

        handledType, wrapAndThrow
      • Methods inherited from class com.fasterxml.jackson.databind.JsonSerializer

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

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait