Deprecated
as a consequence of StdScalarSerializer being deprecated. See corresponding docs for further information.
Since this is one of "natural" (aka "native") types, no type information is ever included on serialization (unlike for most other scalar types)
| Modifier and Type | Class and Description |
|---|---|
| pack-priv static class | BooleanSerializer.AsNumber
Deprecated
as a consequence of Alternate implementation that is used when values are to be serialized
as numbers StdScalarSerializer being deprecated.
0 (false) or 1 (true).
|
| Modifier and Type | Field and Description |
|---|---|
| protected final boolean | _forPrimitive
Whether type serialized is primitive (boolean) or wrapper (java.lang.Boolean); if true, former, if false, latter. |
| private static final long |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | acceptJsonFormatVisitor(JsonFormatVisitorWrapper visitor, JavaType
Type of element (entity like property) being visited typeHint)Overrides com. Implements com. |
| public JsonSerializer | createContextual(SerializerProvider
Serializer provider to use for accessing config, other serializers serializers, BeanProperty 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 cannot provide it and
null is passed instead (in which case impls usually pass 'this' serializer as is) property)Implements com. |
| public JsonNode | getSchema(SerializerProvider
The serializer provider. provider, Type A hint about the type. typeHint)Overrides com. Implements com.
Deprecated
Since 2.15
Default implementation simply claims type is "string"; usually
overriden by custom serializers.
|
| public void | serialize(Object
Value to serialize; can not be null. value, JsonGenerator Generator used to output resulting Json content g, SerializerProvider Provider that can be used to get serializers for
serializing Objects value contains, if any. provider)Implements abstract com. |
| public final void | serializeWithType(Object
Value to serialize; can not be null. value, JsonGenerator Generator used to output resulting Json content g, SerializerProvider Provider that can be used to get serializers for
serializing Objects value contains, if any. provider, TypeSerializer Type serializer to use for including type information typeSer)Overrides com. |
| _forPrimitive | back to summary |
|---|---|
| protected final boolean _forPrimitive Whether type serialized is primitive (boolean) or wrapper (java.lang.Boolean); if true, former, if false, latter. | |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID Hides com. | |
| BooleanSerializer | back to summary |
|---|---|
| public BooleanSerializer(boolean forPrimitive) | |
| acceptJsonFormatVisitor | back to summary |
|---|---|
| public void acceptJsonFormatVisitor(JsonFormatVisitorWrapper visitor, JavaType typeHint) throws JsonMappingException Overrides com. Implements com. Doc from com. Default implementation specifies no format. This behavior is usually overriden by custom serializers.
| |
| createContextual | back to summary |
|---|---|
| public JsonSerializer Implements com. Doc from com. 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.
| |
| getSchema | back to summary |
|---|---|
| public JsonNode getSchema(SerializerProvider provider, Type typeHint) Overrides com. Implements com. Doc from com. Deprecated Since 2.15 Default implementation simply claims type is "string"; usually overriden by custom serializers.
| |
| serialize | back to summary |
|---|---|
| public void serialize(Object value, JsonGenerator g, SerializerProvider provider) throws IOException Implements abstract com. Doc from com. Method that can be called to ask implementation to serialize values of type this serializer handles.
| |
| serializeWithType | back to summary |
|---|---|
| public final void serializeWithType(Object value, JsonGenerator g, SerializerProvider provider, TypeSerializer typeSer) throws IOException Overrides com. Doc from com. Default implementation will write type prefix, call regular serialization method (since assumption is that value itself does not need JSON Array or Object start/end markers), and then write type suffix. This should work for most cases; some sub-classes may want to change this behavior.
| |
Deprecated
as a consequence of StdScalarSerializer being deprecated. See corresponding docs for further information.
0 (false) or 1 (true).
| Modifier and Type | Field and Description |
|---|---|
| protected final boolean | _forPrimitive
Whether type serialized is primitive (boolean) or wrapper (java.lang.Boolean); if true, former, if false, latter. |
| private static final long |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | acceptJsonFormatVisitor(JsonFormatVisitorWrapper visitor, JavaType
Type of element (entity like property) being visited typeHint)Overrides com. Implements com. |
| public JsonSerializer | createContextual(SerializerProvider
Serializer provider to use for accessing config, other serializers serializers, BeanProperty 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 cannot provide it and
null is passed instead (in which case impls usually pass 'this' serializer as is) property)Implements com. |
| public void | serialize(Object
Value to serialize; can not be null. value, JsonGenerator Generator used to output resulting Json content g, SerializerProvider Provider that can be used to get serializers for
serializing Objects value contains, if any. provider)Implements abstract com. |
| public final void | serializeWithType(Object
Value to serialize; can not be null. value, JsonGenerator Generator used to output resulting Json content g, SerializerProvider Provider that can be used to get serializers for
serializing Objects value contains, if any. provider, TypeSerializer Type serializer to use for including type information typeSer)Overrides com. |
| _forPrimitive | back to summary |
|---|---|
| protected final boolean _forPrimitive Whether type serialized is primitive (boolean) or wrapper (java.lang.Boolean); if true, former, if false, latter. | |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID Hides com. | |
| AsNumber | back to summary |
|---|---|
| public AsNumber(boolean forPrimitive) | |
| acceptJsonFormatVisitor | back to summary |
|---|---|
| public void acceptJsonFormatVisitor(JsonFormatVisitorWrapper visitor, JavaType typeHint) throws JsonMappingException Overrides com. Implements com. Doc from com. Default implementation specifies no format. This behavior is usually overriden by custom serializers.
| |
| createContextual | back to summary |
|---|---|
| public JsonSerializer Implements com. Doc from com. 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.
| |
| serialize | back to summary |
|---|---|
| public void serialize(Object value, JsonGenerator g, SerializerProvider provider) throws IOException Implements abstract com. Doc from com. Method that can be called to ask implementation to serialize values of type this serializer handles.
| |
| serializeWithType | back to summary |
|---|---|
| public final void serializeWithType(Object value, JsonGenerator g, SerializerProvider provider, TypeSerializer typeSer) throws IOException Overrides com. Doc from com. Default implementation will write type prefix, call regular serialization method (since assumption is that value itself does not need JSON Array or Object start/end markers), and then write type suffix. This should work for most cases; some sub-classes may want to change this behavior.
| |