Anyframe Web

anyframe.web.struts.util.ria.mip
Class ReflectionHelp

java.lang.Object
  extended by anyframe.web.struts.util.ria.mip.ReflectionHelp

public class ReflectionHelp
extends java.lang.Object

Author:
SoYon Lim, JongHoon Kim

Constructor Summary
ReflectionHelp()
           
 
Method Summary
static java.lang.reflect.Field[] getAllDeclaredFields(java.lang.Class target)
          Get all declared fields - helpful for retrieving all the fields of an object, including those inherited from parent classes.
static java.util.List getFields(java.lang.Object bean)
          Get all declared fields - helpful for retrieving all the fields of an object, including those inherited from parent classes.
static java.lang.Object getFieldValue(java.lang.reflect.Field field, java.lang.Object bean)
          Get a field's value.
static java.lang.Object newInstance(java.lang.Class createClass)
          Factory method that returns a new instance of the given Class.
static void setField(java.lang.reflect.Field field, java.lang.Object bean, java.lang.Object value)
          Set a field's value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ReflectionHelp

public ReflectionHelp()
Method Detail

getAllDeclaredFields

public static java.lang.reflect.Field[] getAllDeclaredFields(java.lang.Class target)
Get all declared fields - helpful for retrieving all the fields of an object, including those inherited from parent classes.

Parameters:
target - The class to examine.
Returns:
Array of fields.

getFields

public static java.util.List getFields(java.lang.Object bean)
Get all declared fields - helpful for retrieving all the fields of an object, including those inherited from parent classes.

Parameters:
bean - The object to examine.
Returns:
List of all the fields.

setField

public static void setField(java.lang.reflect.Field field,
                            java.lang.Object bean,
                            java.lang.Object value)
Set a field's value.

Parameters:
field - The class field to set.
bean - The specific object that contains the field.
value - The value that will be applied to the field.

getFieldValue

public static java.lang.Object getFieldValue(java.lang.reflect.Field field,
                                             java.lang.Object bean)
Get a field's value.

Parameters:
field - The class field.
bean - The specific object to examine.
Returns:
The value of the field.

newInstance

public static java.lang.Object newInstance(java.lang.Class createClass)
Factory method that returns a new instance of the given Class.

Parameters:
createClass - The Class to create an object from.
Returns:
A newly created object of the Class.

Anyframe Web

Copyright © 2008-2009 Samsung SDS. All Rights Reserved.