public abstract class ParameterizedTypeSerializer<T> extends JavaTypeSerializer<T>
Collection
.
The parameters are optional, if not set, on serialization they will be assumed from the element's type and on parse, they will be assumed from the JSON node's type.
Modifier and Type | Field and Description |
---|---|
private JavaTypeSerializer[] |
parameters
The generic parameters for this type, as it appears at the method's parameter definition.
|
BIGDECIMAL_SERIALIZER, BIGINTEGER_SERIALIZER, BOOLEAN_SERIALIZER, BYTEARRAY_SERIALIZER, DOUBLE_SERIALIZER, FLOAT_SERIALIZER, INTEGER_SERIALIZER, LONG_SERIALIZER, mapper, SHORT_SERIALIZER, STRING_SERIALIZER
Constructor and Description |
---|
ParameterizedTypeSerializer(java.lang.Class<T> type)
Create a new generic type.
|
Modifier and Type | Method and Description |
---|---|
protected JavaTypeSerializer |
getSafeParameter(int idx)
Get the serializer for the generic parameter on the specified index.
|
void |
setParameters(JavaTypeSerializer[] parameters)
Set the serializer for each generic parameters.
|
fromJson, fromJson, getSerializer, getSerializer, getType, initialize, newInstance, newRecord, readArray, readArray, readArray, readMap, resolveJavaType, toJson, toJsonArray, toJsonObject
private JavaTypeSerializer[] parameters
public ParameterizedTypeSerializer(java.lang.Class<T> type)
type
- A type which supports generics.public void setParameters(JavaTypeSerializer[] parameters)
parameters
- The serializer for each generic parameter.protected JavaTypeSerializer getSafeParameter(int idx)
idx
- The index in the parameters
.null
if the parameters
are not set or the index is
outside of the array.