org.xwiki.component.util
Class ReflectionUtils
java.lang.Object
org.xwiki.component.util.ReflectionUtils
public final class ReflectionUtils
- extends Object
Various Reflection utilities.
- Since:
- 2.1RC1
- Version:
- $Id$
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
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 fieldfieldName - the name of the field in the objectfieldValue - the value to set for the provided field
Copyright © 2004-2011 XWiki. All Rights Reserved.