Class ReflectionUtils

java.lang.Object
com.bencodez.advancedcore.nms.ReflectionUtils

@Deprecated public class ReflectionUtils extends Object
Deprecated.
A collection of Reflection Methods that return null rather than throwing Exceptions for cleaner code
Author:
Florian
  • Constructor Details

    • ReflectionUtils

      public ReflectionUtils(Object object, Class<?> clazz)
      Deprecated.
  • Method Details

    • constructObject

      public static Object constructObject(Constructor<?> constructor, Object... args)
      Deprecated.
    • getClassForName

      public static Class<?> getClassForName(String name)
      Deprecated.
    • getFieldValue

      public static Object getFieldValue(Field field, Object object)
      Deprecated.
    • invokeMethod

      public static Object invokeMethod(Method method, Object object, Object... args)
      Deprecated.
    • removeModifier

      public static int removeModifier(Object fieldOrMethod, int modifierToRemove)
      Deprecated.
    • setField

      public static Object setField(Field field, Object object, Object newValue)
      Deprecated.
      Sets the value of the specified Field
      Parameters:
      field - The field who's value should be changed
      object - object from which the represented field's value is to be extracted
      newValue - the new value for the field of object being modified
      Returns:
      The old value of this Field
    • setModifiers

      public static int setModifiers(Object fieldOrMethod, int newMods)
      Deprecated.
      Sets the modifiers of the specified Field or Method
      Parameters:
      fieldOrMethod - The object that represents the Field / Method
      newMods - the new modifiers
      Returns:
      the old modifiers
    • getClazz

      public Class<?> getClazz()
      Deprecated.
    • getConstructor

      public Constructor<?> getConstructor(Class<?>... params)
      Deprecated.
    • getFieldDeclared

      public Field getFieldDeclared(String name)
      Deprecated.
    • getMethodDeclared

      public Method getMethodDeclared(String name, Class<?>... params)
      Deprecated.
    • getObject

      public Object getObject()
      Deprecated.
    • getSuperClassField

      public Field getSuperClassField(String name)
      Deprecated.
    • getSuperClassMethod

      public Method getSuperClassMethod(String name, Class<?>... params)
      Deprecated.