public class ObfuscationReflectionHelper
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static class |
ObfuscationReflectionHelper.UnableToAccessFieldException |
static class |
ObfuscationReflectionHelper.UnableToFindFieldException |
static class |
ObfuscationReflectionHelper.UnableToFindMethodException |
static class |
ObfuscationReflectionHelper.UnknownConstructorException |
| Constructor and Description |
|---|
ObfuscationReflectionHelper() |
| Modifier and Type | Method and Description |
|---|---|
static <T> java.lang.reflect.Constructor<T> |
findConstructor(java.lang.Class<T> klass,
java.lang.Class<?>... parameterTypes)
Finds a constructor in the specified class that has matching parameter types.
|
static java.lang.reflect.Method |
findMethod(java.lang.Class<?> clazz,
java.lang.String methodName,
java.lang.Class<?>... parameterTypes)
Finds a method with the specified name and parameters in the given class and makes it accessible.
|
static <T,E> T |
getPrivateValue(java.lang.Class<? super E> classToAccess,
E instance,
int fieldIndex) |
static <T,E> T |
getPrivateValue(java.lang.Class<? super E> classToAccess,
E instance,
java.lang.String fieldName) |
static java.lang.String |
remapName(cpw.mods.modlauncher.api.INameMappingService.Domain domain,
java.lang.String name) |
static <T,E> void |
setPrivateValue(java.lang.Class<? super T> classToAccess,
T instance,
E value,
int fieldIndex) |
static <T,E> void |
setPrivateValue(java.lang.Class<? super T> classToAccess,
T instance,
E value,
java.lang.String fieldName) |
public static java.lang.String remapName(cpw.mods.modlauncher.api.INameMappingService.Domain domain,
java.lang.String name)
public static <T,E> T getPrivateValue(java.lang.Class<? super E> classToAccess,
E instance,
int fieldIndex)
public static <T,E> T getPrivateValue(java.lang.Class<? super E> classToAccess,
E instance,
java.lang.String fieldName)
public static <T,E> void setPrivateValue(java.lang.Class<? super T> classToAccess,
T instance,
E value,
int fieldIndex)
public static <T,E> void setPrivateValue(java.lang.Class<? super T> classToAccess,
T instance,
E value,
java.lang.String fieldName)
@Nonnull
public static java.lang.reflect.Method findMethod(@Nonnull
java.lang.Class<?> clazz,
@Nonnull
java.lang.String methodName,
java.lang.Class<?>... parameterTypes)
Throws an exception if the method is not found.
clazz - The class to find the method on.methodName - The SRG (obfuscated) name of the method to find(e.g. "func_12820_D").parameterTypes - The parameter types of the method to find.@Nonnull
public static <T> java.lang.reflect.Constructor<T> findConstructor(@Nonnull
java.lang.Class<T> klass,
@Nonnull
java.lang.Class<?>... parameterTypes)
T - The typeklass - The class to find the constructor inparameterTypes - The parameter types of the constructor.java.lang.NullPointerException - if klass is nulljava.lang.NullPointerException - if parameterTypes is nullObfuscationReflectionHelper.UnknownConstructorException - if the constructor could not be found