jodd.bean
Class BeanUtilUtil

java.lang.Object
  extended by jodd.bean.BeanUtilUtil
Direct Known Subclasses:
BeanUtil

public class BeanUtilUtil
extends java.lang.Object

Various bean property utilities that makes writings of BeanUtil classes easy.


Constructor Summary
BeanUtilUtil()
           
 
Method Summary
protected static java.lang.Object arrayForcedGet(jodd.bean.BeanProperty bp, java.lang.Object array, int index)
          Returns the element of an array forced.
protected static void arrayForcedSet(jodd.bean.BeanProperty bp, java.lang.Object array, int index, java.lang.Object value)
          Sets the array element forced.
protected static java.lang.Object createBeanProperty(jodd.bean.BeanProperty bp)
          Creates new instance for current property name through its setter.
protected static java.lang.Object ensureArraySize(jodd.bean.BeanProperty bp, java.lang.Object array, java.lang.Class componentType, int index)
           
protected static void ensureListSize(java.util.List list, int size)
           
protected static java.lang.Class extracticGenericType(jodd.bean.BeanProperty bp, int index)
          Extracts generic parameter types.
protected static java.lang.String extractIndex(jodd.bean.BeanProperty bp)
          Extract index string from non-nested property name.
protected static java.lang.Object getField(java.lang.Object bean, java.lang.reflect.Field f)
          Return value of a field.
protected static java.lang.Object invokeGetter(java.lang.Object bean, java.lang.reflect.Method m)
          Invokes getXxx() method of specified bean.
protected static void invokeSetter(java.lang.Object bean, java.lang.reflect.Method m, java.lang.Object value)
          Invokes setXxx() method with appropriate conversion if available.
protected static int parseInt(java.lang.String indexString, jodd.bean.BeanProperty bp)
           
protected static void setField(java.lang.Object bean, java.lang.reflect.Field f, java.lang.Object value)
          Sets field value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BeanUtilUtil

public BeanUtilUtil()
Method Detail

invokeSetter

protected static void invokeSetter(java.lang.Object bean,
                                   java.lang.reflect.Method m,
                                   java.lang.Object value)
Invokes setXxx() method with appropriate conversion if available. It is assumed that all provided arguments are valid.


invokeGetter

protected static java.lang.Object invokeGetter(java.lang.Object bean,
                                               java.lang.reflect.Method m)
Invokes getXxx() method of specified bean. It is assumed that all provided arguments are valid.


setField

protected static void setField(java.lang.Object bean,
                               java.lang.reflect.Field f,
                               java.lang.Object value)
Sets field value.


getField

protected static java.lang.Object getField(java.lang.Object bean,
                                           java.lang.reflect.Field f)
Return value of a field.


arrayForcedGet

protected static java.lang.Object arrayForcedGet(jodd.bean.BeanProperty bp,
                                                 java.lang.Object array,
                                                 int index)
Returns the element of an array forced. If value is null, it will be instantiated. If not the last part of indexed bean property, array will be expanded to the index if necessary.


arrayForcedSet

protected static void arrayForcedSet(jodd.bean.BeanProperty bp,
                                     java.lang.Object array,
                                     int index,
                                     java.lang.Object value)
Sets the array element forced. If index is greater then arrays length, array will be expanded to the index. If speed is critical, it is better to allocate an array with proper size before using this method.


ensureArraySize

protected static java.lang.Object ensureArraySize(jodd.bean.BeanProperty bp,
                                                  java.lang.Object array,
                                                  java.lang.Class componentType,
                                                  int index)

ensureListSize

protected static void ensureListSize(java.util.List list,
                                     int size)

extractIndex

protected static java.lang.String extractIndex(jodd.bean.BeanProperty bp)
Extract index string from non-nested property name. If index is found, it is stripped from bean property name. If no index is found, it returns null.


parseInt

protected static int parseInt(java.lang.String indexString,
                              jodd.bean.BeanProperty bp)

createBeanProperty

protected static java.lang.Object createBeanProperty(jodd.bean.BeanProperty bp)
Creates new instance for current property name through its setter. It uses default constructor!


extracticGenericType

protected static java.lang.Class extracticGenericType(jodd.bean.BeanProperty bp,
                                                      int index)
Extracts generic parameter types.



Copyright ©2008 Jodd Team