jodd.bean
Class BeanUtilUtil

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

public class BeanUtilUtil
extends java.lang.Object

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


Field Summary
protected  TypeConverterManagerBean typeConverterManager
           
 
Constructor Summary
BeanUtilUtil()
           
 
Method Summary
protected  java.lang.Object arrayForcedGet(jodd.bean.BeanProperty bp, java.lang.Object array, int index)
          Returns the element of an array forced.
protected  void arrayForcedSet(jodd.bean.BeanProperty bp, java.lang.Object array, int index, java.lang.Object value)
          Sets the array element forced.
protected  java.lang.Object convertType(java.lang.Object value, java.lang.Class type)
          Converts object to destination type.
protected  java.lang.Object createBeanProperty(jodd.bean.BeanProperty bp)
          Creates new instance for current property name through its setter.
protected  java.lang.Object ensureArraySize(jodd.bean.BeanProperty bp, java.lang.Object array, java.lang.Class componentType, int index)
           
protected  void ensureListSize(java.util.List list, int size)
           
protected  java.lang.Class extracticGenericType(jodd.bean.BeanProperty bp, int index)
          Extracts generic parameter types.
protected  java.lang.String extractIndex(jodd.bean.BeanProperty bp)
          Extract index string from non-nested property name.
protected  java.lang.Class extractType(jodd.bean.BeanProperty bp)
          Extracts type of current property.
protected  java.lang.Object getField(java.lang.Object bean, java.lang.reflect.Field f)
          Return value of a field.
protected  int indexOfDot(java.lang.String name)
          Finds the very first next dot.
protected  java.lang.Object invokeGetter(java.lang.Object bean, java.lang.reflect.Method m)
          Invokes getXxx() method of specified bean.
protected  void invokeSetter(java.lang.Object bean, java.lang.reflect.Method m, java.lang.Object value)
          Invokes setXxx() method with appropriate conversion if available.
protected  int parseInt(java.lang.String indexString, jodd.bean.BeanProperty bp)
           
protected  void setField(java.lang.Object bean, java.lang.reflect.Field f, java.lang.Object value)
          Sets field value.
 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

typeConverterManager

protected TypeConverterManagerBean typeConverterManager
Constructor Detail

BeanUtilUtil

public BeanUtilUtil()
Method Detail

setTypeConverterManager

public void setTypeConverterManager(TypeConverterManagerBean typeConverterManager)
Sets custom type converter manager.


convertType

protected java.lang.Object convertType(java.lang.Object value,
                                       java.lang.Class type)
Converts object to destination type. Invoked before the value is set into destination.


invokeSetter

protected 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 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 void setField(java.lang.Object bean,
                        java.lang.reflect.Field f,
                        java.lang.Object value)
Sets field value.


getField

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


arrayForcedGet

protected 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 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 java.lang.Object ensureArraySize(jodd.bean.BeanProperty bp,
                                           java.lang.Object array,
                                           java.lang.Class componentType,
                                           int index)

ensureListSize

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

indexOfDot

protected int indexOfDot(java.lang.String name)
Finds the very first next dot. Ignores dots between index brackets.


extractIndex

protected 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 int parseInt(java.lang.String indexString,
                       jodd.bean.BeanProperty bp)

createBeanProperty

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


extracticGenericType

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


extractType

protected java.lang.Class extractType(jodd.bean.BeanProperty bp)
Extracts type of current property.



Copyright © 2003-2012 Jodd Team