org.xwiki.component.util
Class ReflectionUtils

java.lang.Object
  extended by org.xwiki.component.util.ReflectionUtils

public final class ReflectionUtils
extends Object

Various Reflection utilities.

Since:
2.1RC1
Version:
$Id$

Method Summary
static Collection<Field> getAllFields(Class<?> componentClass)
           
static void setFieldValue(Object instanceContainingField, String fieldName, Object fieldValue)
          Sets a value to a field using reflection even if the field is private.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getAllFields

public static Collection<Field> getAllFields(Class<?> componentClass)
Parameters:
componentClass - the class for which to return all fields
Returns:
all fields declared by the passed class and its superclasses

setFieldValue

public static void setFieldValue(Object instanceContainingField,
                                 String fieldName,
                                 Object fieldValue)
Sets a value to a field using reflection even if the field is private.

Parameters:
instanceContainingField - the object containing the field
fieldName - the name of the field in the object
fieldValue - the value to set for the provided field


Copyright © 2004-2011 XWiki. All Rights Reserved.