Class StdSerializers.NumberSerializer

  • All Implemented Interfaces:
    SchemaAware
    Enclosing class:
    StdSerializers

    public static final class StdSerializers.NumberSerializer
    extends ScalarSerializerBase<java.lang.Number>
    As a fallback, we may need to use this serializer for other types of Numbers (custom types).
    • Constructor Detail

      • NumberSerializer

        public NumberSerializer()
    • Method Detail

      • serialize

        public void serialize​(java.lang.Number value,
                              JsonGenerator jgen,
                              SerializerProvider provider)
                       throws java.io.IOException,
                              JsonGenerationException
        Description copied from class: JsonSerializer
        Method that can be called to ask implementation to serialize values of type this serializer handles.
        Specified by:
        serialize in class SerializerBase<java.lang.Number>
        Parameters:
        value - Value to serialize; can not be null.
        jgen - Generator used to output resulting Json content
        provider - Provider that can be used to get serializers for serializing Objects value contains, if any.
        Throws:
        java.io.IOException
        JsonGenerationException