public class ReflectionPropertySetter extends Object implements PropertySetter
PropertySetter using Java reflection| Modifier and Type | Field and Description |
|---|---|
protected Class |
entityClass |
protected Field |
f |
protected String |
fn |
protected Method |
m |
protected String |
mn |
protected PropertyGetter.NullValuePolicy |
nullValuePolicy |
protected Osgl.Function<Class<?>,Object> |
objectFactory |
protected Class |
propertyClass |
protected String |
propertyClassName |
protected Osgl.Func2<String,Class<?>,?> |
stringValueResolver |
| Constructor and Description |
|---|
ReflectionPropertySetter(Class c,
Method m,
Field f) |
ReflectionPropertySetter(Osgl.Function<Class<?>,Object> objectFactory,
Osgl.Func2<String,Class<?>,?> stringValueResolver,
Class entityClass,
Method m,
Field f) |
| Modifier and Type | Method and Description |
|---|---|
protected Object |
convertValue(Class requiredClass,
Object value) |
protected void |
doSet(Object entity,
Object value) |
protected void |
ensureMethodOrField(Object obj) |
Class |
getPropertyClass(Object entity) |
void |
set(Object entity,
Object value,
Object index)
After calling this method, the value will be set on a property of an entity object
|
void |
setNullValuePolicy(PropertyGetter.NullValuePolicy nvp) |
void |
setObjectFactory(Osgl.Function<Class<?>,Object> factory) |
void |
setStringValueResolver(Osgl.Func2<String,Class<?>,?> stringValueResolver) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitsetObjectFactory, setStringValueResolverprotected transient Class entityClass
protected transient Method m
protected String mn
protected transient Field f
protected String fn
protected transient Class propertyClass
protected String propertyClassName
protected Osgl.Function<Class<?>,Object> objectFactory
protected Osgl.Func2<String,Class<?>,?> stringValueResolver
protected PropertyGetter.NullValuePolicy nullValuePolicy
public ReflectionPropertySetter(Osgl.Function<Class<?>,Object> objectFactory, Osgl.Func2<String,Class<?>,?> stringValueResolver, Class entityClass, Method m, Field f)
public void set(Object entity, Object value, Object index)
PropertySetterset in interface PropertySetterentity - the entity objectvalue - the valueindex - optional index, used when the property is a List or Mapprotected void ensureMethodOrField(Object obj)
public void setObjectFactory(Osgl.Function<Class<?>,Object> factory)
setObjectFactory in interface PropertyHandlerpublic void setStringValueResolver(Osgl.Func2<String,Class<?>,?> stringValueResolver)
setStringValueResolver in interface PropertyHandlerpublic void setNullValuePolicy(PropertyGetter.NullValuePolicy nvp)
Copyright © 2017. All Rights Reserved.