org.codehaus.plexus.util
Class ReflectionUtils

java.lang.Object
  extended byorg.codehaus.plexus.util.ReflectionUtils

public final class ReflectionUtils
extends java.lang.Object

Version:
$Id: ReflectionUtils.java 2402 2005-08-15 23:33:05Z kenney $
Author:
Michal Maczka

Constructor Summary
private ReflectionUtils()
           
 
Method Summary
static java.lang.reflect.Field getFieldByNameIncludingSuperclasses(java.lang.String fieldName, java.lang.Class clazz)
           
static java.lang.reflect.Method getSetter(java.lang.String fieldName, java.lang.Class clazz)
          Finds a setter in the given class for the given field.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ReflectionUtils

private ReflectionUtils()
Method Detail

getFieldByNameIncludingSuperclasses

public static java.lang.reflect.Field getFieldByNameIncludingSuperclasses(java.lang.String fieldName,
                                                                          java.lang.Class clazz)

getSetter

public static java.lang.reflect.Method getSetter(java.lang.String fieldName,
                                                 java.lang.Class clazz)
Finds a setter in the given class for the given field. It searches interfaces and superclasses too.

Parameters:
fieldName - the name of the field (i.e. 'fooBar'); it will search for a method named 'setFooBar'.
Returns:
null or the method found.