Class NumberSerializers.Base<T>
java.lang.Object
edu.internet2.middleware.grouperClientExt.com.fasterxml.jackson.databind.JsonSerializer<T>
edu.internet2.middleware.grouperClientExt.com.fasterxml.jackson.databind.ser.std.StdSerializer<T>
edu.internet2.middleware.grouperClientExt.com.fasterxml.jackson.databind.ser.std.StdScalarSerializer<T>
edu.internet2.middleware.grouperClientExt.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
public abstract static class NumberSerializers.Base<T>
extends StdScalarSerializer<T>
implements ContextualSerializer
Shared base class for actual primitive/wrapper number serializers.
Note that this class is not meant as general-purpose base class nor
is it part of public API: you may extend it with the caveat that not
being part of public API its implementation and interfaces may change
in minor releases; however deprecation markers will be used to allow
code evolution.
NOTE: public
since 2.10: previously had protected
access.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class edu.internet2.middleware.grouperClientExt.com.fasterxml.jackson.databind.JsonSerializer
JsonSerializer.None
-
Field Summary
Modifier and TypeFieldDescriptionprotected final boolean
protected final JsonParser.NumberType
protected final String
Fields inherited from class edu.internet2.middleware.grouperClientExt.com.fasterxml.jackson.databind.ser.std.StdSerializer
_handledType
-
Constructor Summary
ModifierConstructorDescriptionprotected
Base
(Class<?> cls, JsonParser.NumberType numberType, String schemaType) -
Method Summary
Modifier and TypeMethodDescriptionvoid
acceptJsonFormatVisitor
(JsonFormatVisitorWrapper visitor, JavaType typeHint) Default implementation specifies no format.createContextual
(SerializerProvider prov, BeanProperty property) Method called to see if a different (or differently configured) serializer is needed to serialize values of specified property.getSchema
(SerializerProvider provider, Type typeHint) Default implementation simply claims type is "string"; usually overriden by custom serializers.Methods inherited from class edu.internet2.middleware.grouperClientExt.com.fasterxml.jackson.databind.ser.std.StdScalarSerializer
serializeWithType
Methods inherited from class edu.internet2.middleware.grouperClientExt.com.fasterxml.jackson.databind.ser.std.StdSerializer
_neitherNull, _nonEmpty, createSchemaNode, createSchemaNode, findAnnotatedContentSerializer, findContextualConvertingSerializer, findConvertingContentSerializer, findFormatFeature, findFormatOverrides, findIncludeOverrides, findPropertyFilter, getSchema, handledType, isDefaultSerializer, serialize, visitArrayFormat, visitArrayFormat, visitFloatFormat, visitIntFormat, visitIntFormat, visitStringFormat, visitStringFormat, wrapAndThrow, wrapAndThrow
Methods inherited from class edu.internet2.middleware.grouperClientExt.com.fasterxml.jackson.databind.JsonSerializer
getDelegatee, isEmpty, isEmpty, isUnwrappingSerializer, properties, replaceDelegatee, unwrappingSerializer, usesObjectId, withFilterId
-
Field Details
-
_numberType
-
_schemaType
-
_isInt
protected final boolean _isInt
-
-
Constructor Details
-
Base
-
-
Method Details
-
getSchema
Description copied from class:StdSerializer
Default implementation simply claims type is "string"; usually overriden by custom serializers.- Specified by:
getSchema
in interfaceSchemaAware
- Overrides:
getSchema
in classStdScalarSerializer<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 interfaceJsonFormatVisitable
- Overrides:
acceptJsonFormatVisitor
in classStdScalarSerializer<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 interfaceContextualSerializer
- Parameters:
prov
- Serializer provider to use for accessing config, other serializersproperty
- 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)- Returns:
- Serializer to use for serializing values of specified property; may be this instance or a new instance.
- Throws:
JsonMappingException
-