|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjodd.bean.BeanUtilBean
public class BeanUtilBean
Instantiable version of BeanUtil.
| Field Summary | |
|---|---|
static String |
THIS_REF
|
protected TypeConverterManagerBean |
typeConverterManager
|
| Constructor Summary | |
|---|---|
BeanUtilBean()
|
|
| Method Summary | |
|---|---|
protected Object |
arrayForcedGet(jodd.bean.BeanProperty bp,
Object array,
int index)
Returns the element of an array forced. |
protected void |
arrayForcedSet(jodd.bean.BeanProperty bp,
Object array,
int index,
Object value)
Sets the array element forced. |
protected Object |
convertType(Object value,
Class type)
Converts object to destination type. |
protected Object |
createBeanProperty(jodd.bean.BeanProperty bp)
Creates new instance for current property name through its setter. |
protected Object |
ensureArraySize(jodd.bean.BeanProperty bp,
Object array,
Class componentType,
int index)
|
protected void |
ensureListSize(List list,
int size)
|
protected Class |
extracticGenericType(jodd.bean.BeanProperty bp,
int index)
Extracts generic parameter types. |
protected String |
extractIndex(jodd.bean.BeanProperty bp)
Extract index string from non-nested property name. |
String |
extractThisReference(String propertyName)
Extract the first name of this reference. |
protected Class |
extractType(jodd.bean.BeanProperty bp)
Extracts type of current property. |
Object |
getDeclaredProperty(Object bean,
String name)
Returns value of declared bean's property. |
Object |
getDeclaredPropertySilently(Object bean,
String name)
Silently returns value of declared bean's property. |
Class |
getDeclaredPropertyType(Object bean,
String name)
|
protected Object |
getField(Object bean,
Field f)
Return value of a field. |
protected Object |
getIndexProperty(jodd.bean.BeanProperty bp,
boolean suppressSecurity)
Get non-nested property value: either simple or indexed property. |
Object |
getIndexProperty(Object bean,
String property,
boolean suppressSecurity,
boolean forced)
|
Object |
getProperty(Object bean,
String name)
Returns value of bean's property. |
Object |
getPropertySilently(Object bean,
String name)
Silently returns value of bean's property. |
Class |
getPropertyType(Object bean,
String name)
|
protected Object |
getSimpleProperty(jodd.bean.BeanProperty bp,
boolean suppressSecurity)
|
Object |
getSimpleProperty(Object bean,
String property,
boolean suppressSecurity)
Reads simple property. |
Object |
getSimplePropertyForced(Object bean,
String property,
boolean suppressSecurity)
Reads simple property forced: when property value doesn't exist, it will be created. |
boolean |
hasDeclaredProperty(Object bean,
String name)
|
protected boolean |
hasIndexProperty(jodd.bean.BeanProperty bp,
boolean suppressSecurity)
|
boolean |
hasIndexProperty(Object bean,
String property,
boolean suppressSecurity)
|
boolean |
hasProperty(Object bean,
String name)
|
protected boolean |
hasSimpleProperty(jodd.bean.BeanProperty bp,
boolean suppressSecurity)
|
boolean |
hasSimpleProperty(Object bean,
String property,
boolean suppressSecurity)
Returns true if simple property exist. |
protected int |
indexOfDot(String name)
Finds the very first next dot. |
protected Object |
invokeGetter(Object bean,
Method m)
Invokes getXxx() method of specified bean. |
protected void |
invokeSetter(Object bean,
Method m,
Object value)
Invokes setXxx() method with appropriate conversion if available. |
protected int |
parseInt(String indexString,
jodd.bean.BeanProperty bp)
|
void |
populateBean(Object bean,
Map<?,?> map)
Populates bean from a Map. |
void |
populateProperty(Object bean,
String name,
List<?> list)
Populates indexed bean property from a List. |
void |
populateProperty(Object bean,
String name,
Map<?,?> map)
Populates simple bean property from a Map. |
protected boolean |
resolveExistingNestedProperties(jodd.bean.BeanProperty bp)
|
protected void |
resolveNestedProperties(jodd.bean.BeanProperty bp)
Resolves nested property name to the very last indexed property. |
void |
setDeclaredProperty(Object bean,
String name,
Object value)
Sets declared Java Bean property. |
void |
setDeclaredPropertyForced(Object bean,
String name,
Object value)
Sets declared Java Bean property forced. |
boolean |
setDeclaredPropertyForcedSilent(Object bean,
String name,
Object value)
Silently sets declared Java Bean property forced. |
boolean |
setDeclaredPropertySilent(Object bean,
String name,
Object value)
Silently sets declared Java Bean property. |
protected void |
setField(Object bean,
Field f,
Object value)
Sets field value. |
protected void |
setIndexProperty(jodd.bean.BeanProperty bp,
Object value,
boolean suppressSecurity)
Sets indexed or regular properties (no nested!). |
void |
setIndexProperty(Object bean,
String property,
Object value,
boolean suppressSecurity,
boolean forced)
|
void |
setProperty(Object bean,
String name,
Object value)
Sets Java Bean property. |
void |
setPropertyForced(Object bean,
String name,
Object value)
Sets Java Bean property forced. |
boolean |
setPropertyForcedSilent(Object bean,
String name,
Object value)
Sets Java Bean property forced, without throwing an exception on non-existing properties. |
boolean |
setPropertySilent(Object bean,
String name,
Object value)
Sets Java Bean property silently, without throwing an exception on non-existing properties. |
protected void |
setSimpleProperty(jodd.bean.BeanProperty bp,
Object value,
boolean suppressSecurity)
Sets a value of simple property. |
void |
setSimpleProperty(Object bean,
String property,
Object value,
boolean suppressSecurity)
|
void |
setTypeConverterManager(TypeConverterManagerBean typeConverterManager)
Sets custom type converter manager. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String THIS_REF
protected TypeConverterManagerBean typeConverterManager
| Constructor Detail |
|---|
public BeanUtilBean()
| Method Detail |
|---|
protected void resolveNestedProperties(jodd.bean.BeanProperty bp)
null or non-existing properties will be created.
protected boolean resolveExistingNestedProperties(jodd.bean.BeanProperty bp)
public boolean hasSimpleProperty(Object bean,
String property,
boolean suppressSecurity)
true if simple property exist.
protected boolean hasSimpleProperty(jodd.bean.BeanProperty bp,
boolean suppressSecurity)
public Object getSimpleProperty(Object bean,
String property,
boolean suppressSecurity)
public Object getSimplePropertyForced(Object bean,
String property,
boolean suppressSecurity)
protected Object getSimpleProperty(jodd.bean.BeanProperty bp,
boolean suppressSecurity)
public void setSimpleProperty(Object bean,
String property,
Object value,
boolean suppressSecurity)
protected void setSimpleProperty(jodd.bean.BeanProperty bp,
Object value,
boolean suppressSecurity)
public boolean hasIndexProperty(Object bean,
String property,
boolean suppressSecurity)
protected boolean hasIndexProperty(jodd.bean.BeanProperty bp,
boolean suppressSecurity)
public Object getIndexProperty(Object bean,
String property,
boolean suppressSecurity,
boolean forced)
protected Object getIndexProperty(jodd.bean.BeanProperty bp,
boolean suppressSecurity)
public void setIndexProperty(Object bean,
String property,
Object value,
boolean suppressSecurity,
boolean forced)
protected void setIndexProperty(jodd.bean.BeanProperty bp,
Object value,
boolean suppressSecurity)
public void setProperty(Object bean,
String name,
Object value)
public boolean setPropertySilent(Object bean,
String name,
Object value)
public void setPropertyForced(Object bean,
String name,
Object value)
public boolean setPropertyForcedSilent(Object bean,
String name,
Object value)
public void setDeclaredProperty(Object bean,
String name,
Object value)
public boolean setDeclaredPropertySilent(Object bean,
String name,
Object value)
public void setDeclaredPropertyForced(Object bean,
String name,
Object value)
public boolean setDeclaredPropertyForcedSilent(Object bean,
String name,
Object value)
public Object getProperty(Object bean,
String name)
public Object getPropertySilently(Object bean,
String name)
null is ambiguous: it may means that property name
is valid and property value is null or that property name is invalid.
public Object getDeclaredProperty(Object bean,
String name)
public Object getDeclaredPropertySilently(Object bean,
String name)
null is ambiguous: it may means that property name
is valid and property value is null or that property name is invalid.
public boolean hasProperty(Object bean,
String name)
public boolean hasDeclaredProperty(Object bean,
String name)
public Class getPropertyType(Object bean,
String name)
public Class getDeclaredPropertyType(Object bean,
String name)
public void populateBean(Object bean,
Map<?,?> map)
Map.
public void populateProperty(Object bean,
String name,
Map<?,?> map)
Map.
public void populateProperty(Object bean,
String name,
List<?> list)
List.
public String extractThisReference(String propertyName)
public void setTypeConverterManager(TypeConverterManagerBean typeConverterManager)
type converter manager.
protected Object convertType(Object value,
Class type)
protected void invokeSetter(Object bean,
Method m,
Object value)
setXxx() method with appropriate conversion if available.
It is assumed that all provided arguments are valid.
protected Object invokeGetter(Object bean,
Method m)
getXxx() method of specified bean.
It is assumed that all provided arguments are valid.
protected void setField(Object bean,
Field f,
Object value)
protected Object getField(Object bean,
Field f)
protected Object arrayForcedGet(jodd.bean.BeanProperty bp,
Object array,
int index)
null, it will be instantiated.
If not the last part of indexed bean property, array will be expanded to the index if necessary.
protected void arrayForcedSet(jodd.bean.BeanProperty bp,
Object array,
int index,
Object value)
protected Object ensureArraySize(jodd.bean.BeanProperty bp,
Object array,
Class componentType,
int index)
protected void ensureListSize(List list,
int size)
protected int indexOfDot(String name)
protected String extractIndex(jodd.bean.BeanProperty bp)
null.
protected int parseInt(String indexString,
jodd.bean.BeanProperty bp)
protected Object createBeanProperty(jodd.bean.BeanProperty bp)
protected Class extracticGenericType(jodd.bean.BeanProperty bp,
int index)
protected Class extractType(jodd.bean.BeanProperty bp)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||