@Singleton @Primary public class JacksonBeanPropertyBinder extends Object implements BeanPropertyBinder
ArgumentBinder
capable of binding from an object from a map.ArgumentBinder.BindingResult<T>
Constructor and Description |
---|
JacksonBeanPropertyBinder(com.fasterxml.jackson.databind.ObjectMapper objectMapper,
JacksonConfiguration configuration) |
Modifier and Type | Method and Description |
---|---|
ArgumentBinder.BindingResult<Object> |
bind(ArgumentConversionContext<Object> context,
Map<CharSequence,? super Object> source)
Bind the given argument from the given source.
|
<T2> T2 |
bind(Class<T2> type,
Set<? extends Map.Entry<? extends CharSequence,Object>> source)
Bind a new instance of the given type from the given source.
|
<T2> T2 |
bind(T2 object,
ArgumentConversionContext<T2> context,
Set<? extends Map.Entry<? extends CharSequence,Object>> source)
Bind an existing instance of the given type from the given source.
|
<T2> T2 |
bind(T2 object,
Set<? extends Map.Entry<? extends CharSequence,Object>> source)
Bind an existing instance of the given type from the given source.
|
protected ConversionErrorException |
newConversionError(Object object,
Exception e) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
bind, bind, bind, bind
public JacksonBeanPropertyBinder(com.fasterxml.jackson.databind.ObjectMapper objectMapper, JacksonConfiguration configuration)
objectMapper
- To read/write JSONconfiguration
- The configuration for Jackson JSON parserpublic ArgumentBinder.BindingResult<Object> bind(ArgumentConversionContext<Object> context, Map<CharSequence,? super Object> source)
ArgumentBinder
bind
in interface ArgumentBinder<Object,Map<CharSequence,? super Object>>
context
- The ArgumentConversionContext
source
- The sourceOptional
of the value. If no binding was possible Optional.empty()
public <T2> T2 bind(Class<T2> type, Set<? extends Map.Entry<? extends CharSequence,Object>> source) throws ConversionErrorException
BeanPropertyBinder
bind
in interface BeanPropertyBinder
T2
- The generic typetype
- The typesource
- The sourceConversionErrorException
- if the object cannot be boundpublic <T2> T2 bind(T2 object, ArgumentConversionContext<T2> context, Set<? extends Map.Entry<? extends CharSequence,Object>> source)
BeanPropertyBinder
bind
in interface BeanPropertyBinder
T2
- The generic typeobject
- The beancontext
- The conversion contextsource
- The sourcepublic <T2> T2 bind(T2 object, Set<? extends Map.Entry<? extends CharSequence,Object>> source) throws ConversionErrorException
BeanPropertyBinder
bind
in interface BeanPropertyBinder
T2
- The generic typeobject
- The beansource
- The sourceConversionErrorException
- if the object cannot be boundprotected ConversionErrorException newConversionError(Object object, Exception e)
object
- The beane
- The exception object