cpw.mods.fml.relauncher
Class ReflectionHelper

java.lang.Object
  extended by cpw.mods.fml.relauncher.ReflectionHelper

public class ReflectionHelper
extends Object

Some reflection helper code.

Author:
cpw

Nested Class Summary
static class ReflectionHelper.UnableToAccessFieldException
           
static class ReflectionHelper.UnableToFindClassException
           
static class ReflectionHelper.UnableToFindFieldException
           
static class ReflectionHelper.UnableToFindMethodException
           
 
Constructor Summary
ReflectionHelper()
           
 
Method Summary
static Field findField(Class<?> clazz, String... fieldNames)
           
static
<E> Method
findMethod(Class<? super E> clazz, E instance, String[] methodNames, Class<?>... methodTypes)
           
static Class<? super Object> getClass(ClassLoader loader, String... classNames)
           
static
<T,E> T
getPrivateValue(Class<? super E> classToAccess, E instance, int fieldIndex)
           
static
<T,E> T
getPrivateValue(Class<? super E> classToAccess, E instance, String... fieldNames)
           
static
<T,E> void
setPrivateValue(Class<? super T> classToAccess, T instance, E value, int fieldIndex)
           
static
<T,E> void
setPrivateValue(Class<? super T> classToAccess, T instance, E value, String... fieldNames)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ReflectionHelper

public ReflectionHelper()
Method Detail

findField

public static Field findField(Class<?> clazz,
                              String... fieldNames)

getPrivateValue

public static <T,E> T getPrivateValue(Class<? super E> classToAccess,
                                      E instance,
                                      int fieldIndex)

getPrivateValue

public static <T,E> T getPrivateValue(Class<? super E> classToAccess,
                                      E instance,
                                      String... fieldNames)

setPrivateValue

public static <T,E> void setPrivateValue(Class<? super T> classToAccess,
                                         T instance,
                                         E value,
                                         int fieldIndex)

setPrivateValue

public static <T,E> void setPrivateValue(Class<? super T> classToAccess,
                                         T instance,
                                         E value,
                                         String... fieldNames)

getClass

public static Class<? super Object> getClass(ClassLoader loader,
                                             String... classNames)

findMethod

public static <E> Method findMethod(Class<? super E> clazz,
                                    E instance,
                                    String[] methodNames,
                                    Class<?>... methodTypes)