Numbers: both custom types and "big" numbers
like BigInteger and BigDecimal.
| Modifier and Type | Class and Description |
|---|---|
| pack-priv static class |
| Modifier and Type | Field and Description |
|---|---|
| protected final boolean | |
| public static final NumberSerializer | instance
Static instance that is only to be used for |
| protected static final int | MAX_BIG_DECIMAL_SCALE
Copied from `jackson-core` class `GeneratorBase` |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | acceptJsonFormatVisitor(JsonFormatVisitorWrapper visitor, JavaType typeHint)
Overrides tools. Implements tools. Default implementation specifies no format. |
| public static ValueSerializer | |
| public ValueSerializer | createContextual(SerializationContext prov, BeanProperty property)
Overrides tools. Method called to see if a different (or differently configured) serializer is needed to serialize values of specified property (or, for root values, in which case `null` is passed). |
| public void | serialize(Number value, JsonGenerator g, SerializationContext provider)
Implements abstract tools. Method that can be called to ask implementation to serialize values of type this serializer handles. |
| _isInt | back to summary |
|---|---|
| protected final boolean _isInt | |
| instance | back to summary |
|---|---|
| public static final NumberSerializer instance Static instance that is only to be used for | |
| MAX_BIG_DECIMAL_SCALE | back to summary |
|---|---|
| protected static final int MAX_BIG_DECIMAL_SCALE Copied from `jackson-core` class `GeneratorBase` | |
| NumberSerializer | back to summary |
|---|---|
public NumberSerializer(Class<? extends Number> rawType)
| |
| acceptJsonFormatVisitor | back to summary |
|---|---|
| public void acceptJsonFormatVisitor(JsonFormatVisitorWrapper visitor, JavaType typeHint) Overrides tools. Implements tools. Doc from tools. Default implementation specifies no format. This behavior is usually overriden by custom serializers.
| |
| bigDecimalAsStringSerializer | back to summary |
|---|---|
public static ValueSerializer
| |
| createContextual | back to summary |
|---|---|
| public ValueSerializer Overrides tools. Doc from tools. Method called to see if a different (or differently configured) serializer is needed to serialize values of specified property (or, for root values, in which case `null` is passed). 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. Note that method is only called once per POJO property, and for the first usage as root value serializer; it is not called for every serialization, as doing that would have significant performance impact; most serializers cache contextual instances for future use.
| |
| serialize | back to summary |
|---|---|
| public void serialize(Number value, JsonGenerator g, SerializationContext provider) throws JacksonException Implements abstract tools. Doc from tools. Method that can be called to ask implementation to serialize values of type this serializer handles.
| |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv static final NumberSerializer. |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| protected boolean | |
| public boolean | isEmpty(SerializationContext prov, Object value)
Overrides tools. Method called to check whether given serializable value is considered "empty" value (for purposes of suppressing serialization of empty values). |
| public void | serialize(Object value, JsonGenerator gen, SerializationContext provider)
Overrides tools. Method that can be called to ask implementation to serialize values of type this serializer handles. |
| public String | valueToString(Object value)
Implements abstract tools.
|
| BD_INSTANCE | back to summary |
|---|---|
| pack-priv static final NumberSerializer. | |
| BigDecimalAsStringSerializer | back to summary |
|---|---|
| public BigDecimalAsStringSerializer() | |
| _verifyBigDecimalRange | back to summary |
|---|---|
| protected boolean _verifyBigDecimalRange(JsonGenerator gen, BigDecimal value) | |
| isEmpty | back to summary |
|---|---|
| public boolean isEmpty(SerializationContext prov, Object value) Overrides tools. Doc from tools. Method called to check whether given serializable value is considered "empty" value (for purposes of suppressing serialization of empty values). Default implementation will consider only null values to be empty.
| |
| serialize | back to summary |
|---|---|
| public void serialize(Object value, JsonGenerator gen, SerializationContext provider) throws JacksonException Overrides tools. Doc from tools. Method that can be called to ask implementation to serialize values of type this serializer handles.
| |
| valueToString | back to summary |
|---|---|
| public String valueToString(Object value) Implements abstract tools.
| |