Interface ObjectMapper.Factory
- Enclosing interface:
- ObjectMapper<V>
public static interface ObjectMapper.Factory
Provider for object mappers.
- Since:
- 4.0.0
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interface
A builder for a configured factory producing object mappers. -
Method Summary
Modifier and TypeMethodDescriptionCreates aTypeSerializer
that uses this factory.default <V> ObjectMapper<V>
get
(io.leangen.geantyref.TypeToken<V> type) Get an object mapper for the provided type.default <V> ObjectMapper<V>
Get an object mapper for the unparameterized typeclazz
.ObjectMapper<?>
Get the object mapper for the provided type.
-
Method Details
-
get
default <V> ObjectMapper<V> get(io.leangen.geantyref.TypeToken<V> type) throws SerializationException Get an object mapper for the provided type.The provided type cannot be a raw type.
- Type Parameters:
V
- mapped type- Parameters:
type
- token holding the mapped type- Returns:
- a mapper for the provided type
- Throws:
SerializationException
- if the type does not correspond to a mappable object- Since:
- 4.0.0
-
get
Get an object mapper for the unparameterized typeclazz
.The provided type cannot be a raw type.
- Type Parameters:
V
- mapped type- Parameters:
clazz
- class of the mapped type- Returns:
- a mapper for the provided type
- Throws:
SerializationException
- if the type does not correspond to a mappable object- Since:
- 4.0.0
-
get
Get the object mapper for the provided type.The provided type cannot be a raw type.
- Parameters:
type
- object type.- Returns:
- a mapper for the provided type
- Throws:
SerializationException
- if the type does not correspond to a mappable object- Since:
- 4.0.0
-
asTypeSerializer
Creates aTypeSerializer
that uses this factory.The serializer will accept any object type that could otherwise be handled by this factory. To match a standard configuration, register this serializer with
TypeSerializerCollection.Builder.registerAnnotatedObjects(Factory)
to enforce the presence ofConfigSerializable
annotations.- Returns:
- a type serializer
- Since:
- 4.0.0
-