@Singleton @Primary public class JacksonBeanPropertyBinder extends java.lang.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<java.lang.Object> |
bind(ArgumentConversionContext<java.lang.Object> context,
java.util.Map<java.lang.CharSequence,? super java.lang.Object> source)
Bind the given argument from the given source.
|
<T2> T2 |
bind(java.lang.Class<T2> type,
java.util.Set<? extends java.util.Map.Entry<? extends java.lang.CharSequence,java.lang.Object>> source)
Bind a new instance of the given type from the given source.
|
<T2> T2 |
bind(T2 object,
ArgumentConversionContext<T2> context,
java.util.Set<? extends java.util.Map.Entry<? extends java.lang.CharSequence,java.lang.Object>> source)
Bind an existing instance of the given type from the given source.
|
<T2> T2 |
bind(T2 object,
java.util.Set<? extends java.util.Map.Entry<? extends java.lang.CharSequence,java.lang.Object>> source)
Bind an existing instance of the given type from the given source.
|
protected ConversionErrorException |
newConversionError(java.lang.Object object,
java.lang.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<java.lang.Object> bind(ArgumentConversionContext<java.lang.Object> context, java.util.Map<java.lang.CharSequence,? super java.lang.Object> source)
ArgumentBinder
bind
in interface ArgumentBinder<java.lang.Object,java.util.Map<java.lang.CharSequence,? super java.lang.Object>>
context
- The ArgumentConversionContext
source
- The sourceOptional
of the value. If no binding was possible Optional.empty()
public <T2> T2 bind(java.lang.Class<T2> type, java.util.Set<? extends java.util.Map.Entry<? extends java.lang.CharSequence,java.lang.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, java.util.Set<? extends java.util.Map.Entry<? extends java.lang.CharSequence,java.lang.Object>> source)
BeanPropertyBinder
bind
in interface BeanPropertyBinder
T2
- The generic typeobject
- The beancontext
- The conversion contextsource
- The sourcepublic <T2> T2 bind(T2 object, java.util.Set<? extends java.util.Map.Entry<? extends java.lang.CharSequence,java.lang.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(java.lang.Object object, java.lang.Exception e)
object
- The beane
- The exception object