com.fasterxml.jackson.databind.ser.std

## Class NumberSerializers.Base<T>

- java.lang.Object
- - com.fasterxml.jackson.databind.JsonSerializer<T>
  - - com.fasterxml.jackson.databind.ser.std.StdSerializer<T>
    - - com.fasterxml.jackson.databind.ser.std.StdScalarSerializer<T>
      - - com.fasterxml.jackson.databind.ser.std.NumberSerializers.Base<T>

- All Implemented Interfaces:
    JsonFormatVisitable, SchemaAware, ContextualSerializer, Serializable
  Direct Known Subclasses:
    NumberSerializers.DoubleSerializer, NumberSerializers.FloatSerializer, NumberSerializers.IntegerSerializer, NumberSerializers.IntLikeSerializer, NumberSerializers.LongSerializer, NumberSerializers.ShortSerializer
  Enclosing class:
    NumberSerializers

      protected abstract static class NumberSerializers.Base<T>
      extends StdScalarSerializer<T>
      implements ContextualSerializer

  See Also:
    Serialized Form

- - ### Nested Class Summary

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

      `JsonSerializer.None`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected boolean` | `_isInt`
    `protected com.fasterxml.jackson.core.JsonParser.NumberType` | `_numberType`
    `protected String` | `_schemaType`
    `protected static Integer` | `EMPTY_INTEGER`

    - ### Fields inherited from class com.fasterxml.jackson.databind.ser.std.StdSerializer

      `_handledType`

  - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `Base(Class<?> cls, com.fasterxml.jackson.core.JsonParser.NumberType numberType, String schemaType)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `acceptJsonFormatVisitor(JsonFormatVisitorWrapper visitor, JavaType typeHint)` Default implementation specifies no format.
    `JsonSerializer<?>` | `createContextual(SerializerProvider prov, BeanProperty property)` Method called to see if a different (or differently configured) serializer is needed to serialize values of specified property.
    `JsonNode` | `getSchema(SerializerProvider provider, Type typeHint)` Default implementation simply claims type is "string"; usually overriden by custom serializers.

    - ### Methods inherited from class com.fasterxml.jackson.databind.ser.std.StdScalarSerializer

      `serializeWithType`

    - ### Methods inherited from class com.fasterxml.jackson.databind.ser.std.StdSerializer

      `createObjectNode, createSchemaNode, createSchemaNode, findConvertingContentSerializer, findPropertyFilter, getSchema, handledType, isDefaultSerializer, serialize, wrapAndThrow, wrapAndThrow`

    - ### Methods inherited from class com.fasterxml.jackson.databind.JsonSerializer

      `getDelegatee, isEmpty, isEmpty, isUnwrappingSerializer, properties, replaceDelegatee, unwrappingSerializer, usesObjectId, withFilterId`

    - ### Methods inherited from class java.lang.Object

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

- - ### Field Detail

    - #### EMPTY_INTEGER

          protected static final Integer EMPTY_INTEGER

    - #### _numberType

          protected final com.fasterxml.jackson.core.JsonParser.NumberType _numberType

    - #### _schemaType

          protected final String _schemaType

    - #### _isInt

          protected final boolean _isInt

  - ### Constructor Detail

    - #### Base

          protected Base(Class<?> cls,
                         com.fasterxml.jackson.core.JsonParser.NumberType numberType,
                         String schemaType)

  - ### Method Detail

    - #### getSchema

          public JsonNode getSchema(SerializerProvider provider,
                                    Type typeHint)

      Description copied from class: `StdSerializer`
      Default implementation simply claims type is "string"; usually overriden by custom serializers.
      Specified by:
        `getSchema` in interface `SchemaAware`
      Overrides:
        `getSchema` in class `StdScalarSerializer<T>`
      Parameters:
        `provider` - The serializer provider.
        `typeHint` - A hint about the type.
      Returns:
        Json-schema for this serializer.

    - #### acceptJsonFormatVisitor

          public void acceptJsonFormatVisitor(JsonFormatVisitorWrapper visitor,
                                              JavaType typeHint)
                                       throws JsonMappingException

      Description copied from class: `StdSerializer`
      Default implementation specifies no format. This behavior is usually overriden by custom serializers.
      Specified by:
        `acceptJsonFormatVisitor` in interface `JsonFormatVisitable`
      Overrides:
        `acceptJsonFormatVisitor` in class `StdScalarSerializer<T>`
        `typeHint` - Type of element (entity like property) being visited
      Throws:
        `JsonMappingException`

    - #### createContextual

          public JsonSerializer<?> createContextual(SerializerProvider prov,
                                                    BeanProperty property)
                                             throws JsonMappingException

      Description copied from interface: `ContextualSerializer`
      Method called to see if a different (or differently configured) serializer is needed to serialize values of specified property. Note that instance that this method is called on is typically shared one and as a result method should NOT modify this instance but rather construct and return a new instance. This instance should only be returned as-is, in case it is already suitable for use.
      Specified by:
        `createContextual` in interface `ContextualSerializer`
      Parameters:
        `prov` - Serializer provider to use for accessing config, other serializers
        `property` - Method or field that represents the property (and is used to access value to serialize). Should be available; but there may be cases where caller can not provide it and null is passed instead (in which case impls usually pass 'this' serializer as is)
      Returns:
        Serializer to use for serializing values of specified property; may be this instance or a new instance.
      Throws:
        `JsonMappingException`

Copyright © 2014–2015 FasterXML. All rights reserved.