Class Reflex

java.lang.Object
studio.magemonkey.codex.util.Reflex

@Deprecated(since="1.1.0") public class Reflex extends Object
Deprecated.
Transitioning to version-specific implementations for better stability
This class interacts with Spigot at a reflection level. This is used to hack some things together but should ultimately be removed for a more stable solution.
  • Field Details

    • VERSION

      public static final String VERSION
      Deprecated.
  • Constructor Details

    • Reflex

      public Reflex()
      Deprecated.
  • Method Details

    • getClass

      @Nullable public static Class<?> getClass(@NotNull String path, @NotNull String name)
      Deprecated.
    • getInnerClass

      @Nullable public static Class<?> getInnerClass(@NotNull String path, @NotNull String name)
      Deprecated.
    • getClass

      @Nullable public static Class<?> getClass(@NotNull String path)
      Deprecated.
    • getConstructor

      @Nullable public static Constructor<?> getConstructor(@NotNull Class<?> clazz, Class<?>... types)
      Deprecated.
    • invokeConstructor

      @Nullable public static Object invokeConstructor(@NotNull Constructor<?> con, Object... obj)
      Deprecated.
    • getNMSClass

      @Nullable public static Class<?> getNMSClass(@NotNull String name)
      Deprecated.
    • getCraftPackage

      public static String getCraftPackage()
      Deprecated.
    • getCraftClass

      public static Class<?> getCraftClass(String craftClassString)
      Deprecated.
    • getFields

      @NotNull public static List<Field> getFields(@NotNull Class<?> type)
      Deprecated.
    • getField

      @Nullable public static Field getField(@NotNull Class<?> clazz, @NotNull String fieldName)
      Deprecated.
    • getFieldValue

      @Nullable public static Object getFieldValue(@NotNull Object from, @NotNull String fieldName)
      Deprecated.
    • setFieldValue

      public static boolean setFieldValue(@NotNull Object of, @NotNull String fieldName, @Nullable Object value)
      Deprecated.
    • getMethod

      public static Method getMethod(Object o, String methodName, Class<?>... params)
      Deprecated.
      Tries to get a method from the object
      Parameters:
      o - object reference
      methodName - name of the field to retrieve the value from
      Returns:
      the value of the field or null if not found
    • getMethod

      @Nullable public static Method getMethod(@NotNull Class<?> clazz, @NotNull String fieldName, @NotNull Class<?>... o)
      Deprecated.
    • invokeMethod

      @Nullable public static Object invokeMethod(@NotNull Method m, @Nullable Object by, @Nullable Object... param)
      Deprecated.
    • getEnum

      public static <T extends Enum> T getEnum(Class<?> clazz, String enumName)
      Deprecated.
    • setValue

      public static void setValue(Object o, String fieldName, Object value)
      Deprecated.
      Tries to set a value for the object
      Parameters:
      o - object reference
      fieldName - name of the field to set
      value - value to set
    • getValue

      public static Object getValue(Object o, String fieldName)
      Deprecated.
      Tries to get a value from the object
      Parameters:
      o - object reference
      fieldName - name of the field to retrieve the value from
      Returns:
      the value of the field or null if not found
    • getInstance

      public static Object getInstance(Class<?> c, Object... args)
      Deprecated.
      Gets an instance of the class
      Parameters:
      c - class to get an instance of
      args - constructor arguments
      Returns:
      instance of the class or null if unable to create the object