Interface ObjectMapper.Factory.Builder
-
- Enclosing interface:
- ObjectMapper.Factory
public static interface ObjectMapper.Factory.Builder
A builder for a configured factory producing object mappers.In general, with multiple applicable resolvers, the one registered last will take priority.
- Since:
- 4.0.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description <A extends java.lang.annotation.Annotation,T>
ObjectMapper.Factory.BuilderaddConstraint(java.lang.Class<A> definition, java.lang.Class<T> valueType, Constraint.Factory<A,T> factory)
Register aConstraint
that will be used to validate fields.default <A extends java.lang.annotation.Annotation>
ObjectMapper.Factory.BuilderaddConstraint(java.lang.Class<A> definition, Constraint.Factory<A,java.lang.Object> factory)
Register aConstraint
that will be used to validate fields.ObjectMapper.Factory.Builder
addDiscoverer(FieldDiscoverer<?> discoverer)
Add a discoverer for a type of object.ObjectMapper.Factory.Builder
addNodeResolver(NodeResolver.Factory resolver)
Add a resolver that will locate a node for a field.ObjectMapper.Factory.Builder
addPostProcessor(PostProcessor.Factory factory)
Register an object post-processor with this object mapper.<A extends java.lang.annotation.Annotation,T>
ObjectMapper.Factory.BuilderaddProcessor(java.lang.Class<A> definition, java.lang.Class<T> valueType, Processor.Factory<A,T> factory)
Register aProcessor
that will process fields after write.default <A extends java.lang.annotation.Annotation>
ObjectMapper.Factory.BuilderaddProcessor(java.lang.Class<A> definition, Processor.Factory<A,java.lang.Object> factory)
Register aProcessor
that will process fields after write.ObjectMapper.Factory
build()
Create a new factory using the current configuration.ObjectMapper.Factory.Builder
defaultNamingScheme(NamingScheme scheme)
Set the naming scheme to use as a default for field names.
-
-
-
Method Detail
-
defaultNamingScheme
ObjectMapper.Factory.Builder defaultNamingScheme(NamingScheme scheme)
Set the naming scheme to use as a default for field names.This can be overridden by other
NodeResolvers
for specific nodes.- Parameters:
scheme
- naming scheme- Returns:
- this builder
- Since:
- 4.0.0
-
addNodeResolver
ObjectMapper.Factory.Builder addNodeResolver(NodeResolver.Factory resolver)
Add a resolver that will locate a node for a field.- Parameters:
resolver
- the resolver- Returns:
- this builder
- Since:
- 4.0.0
-
addDiscoverer
ObjectMapper.Factory.Builder addDiscoverer(FieldDiscoverer<?> discoverer)
Add a discoverer for a type of object.Field discoverers will be tried in order until one can produce the appropriate metadata.
- Parameters:
discoverer
- field discoverer- Returns:
- this builder
- Since:
- 4.0.0
-
addProcessor
default <A extends java.lang.annotation.Annotation> ObjectMapper.Factory.Builder addProcessor(java.lang.Class<A> definition, Processor.Factory<A,java.lang.Object> factory)
Register aProcessor
that will process fields after write.Processors registered without a specific data type should be able to operate on any value type.
- Type Parameters:
A
- annotation type- Parameters:
definition
- annotation providing datafactory
- factory for callback function- Returns:
- this builder
- Since:
- 4.0.0
-
addProcessor
<A extends java.lang.annotation.Annotation,T> ObjectMapper.Factory.Builder addProcessor(java.lang.Class<A> definition, java.lang.Class<T> valueType, Processor.Factory<A,T> factory)
Register aProcessor
that will process fields after write.All value types will be tested against types normalized to their boxed variants.
- Type Parameters:
A
- annotation typeT
- data type- Parameters:
definition
- annotation providing datavalueType
- value types the processor will handlefactory
- factory for callback function- Returns:
- this builder
- Since:
- 4.0.0
-
addConstraint
default <A extends java.lang.annotation.Annotation> ObjectMapper.Factory.Builder addConstraint(java.lang.Class<A> definition, Constraint.Factory<A,java.lang.Object> factory)
Register aConstraint
that will be used to validate fields.Constraints registered without a specific data type will be able to operate on any value type.
- Type Parameters:
A
- annotation type- Parameters:
definition
- annotations providing datafactory
- factory for callback function- Returns:
- this builder
- Since:
- 4.0.0
-
addConstraint
<A extends java.lang.annotation.Annotation,T> ObjectMapper.Factory.Builder addConstraint(java.lang.Class<A> definition, java.lang.Class<T> valueType, Constraint.Factory<A,T> factory)
Register aConstraint
that will be used to validate fields.All value types will be tested against types normalized to their boxed variants.
- Type Parameters:
A
- annotation typeT
- data type- Parameters:
definition
- annotations providing datavalueType
- value types the processor will handlefactory
- factory for callback function- Returns:
- this builder
- Since:
- 4.0.0
-
addPostProcessor
ObjectMapper.Factory.Builder addPostProcessor(PostProcessor.Factory factory)
Register an object post-processor with this object mapper.All post-processors will be called, even if one throws an exception.
- Parameters:
factory
- the factory optionally producing a post processor function- Returns:
- this builder
- Since:
- 4.2.0
-
build
ObjectMapper.Factory build()
Create a new factory using the current configuration.- Returns:
- new factory instance
- Since:
- 4.0.0
-
-