Class ReflectionHelper

java.lang.Object
co.crystaldev.alpinecore.util.ReflectionHelper

public final class ReflectionHelper extends Object
Since:
0.3.0
  • Constructor Details

    • ReflectionHelper

      public ReflectionHelper()
  • Method Details

    • findField

      @Nullable public static @Nullable Field findField(@NotNull @NotNull Class<?> clazz, @NotNull @NotNull String... fieldNames)
    • getPrivateValue

      @Nullable public static <T, E> T getPrivateValue(@NotNull @NotNull Class<? super E> classToAccess, @NotNull E instance, @NotNull @NotNull String... fieldNames)
    • setPrivateValue

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

      @NotNull public static @NotNull ClassLoader getContextClassLoader()
    • getClass

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

      @Nullable public static @Nullable Class<? super Object> getClass(@NotNull @NotNull ClassLoader loader, @NotNull @NotNull String className)
    • findMethod

      @Nullable public static @Nullable Method findMethod(@NotNull @NotNull Class<?> clazz, @NotNull @NotNull String methodName, @NotNull @NotNull Class<?>... parameterTypes)
    • findMethod

      @Nullable public static @Nullable Method findMethod(@NotNull @NotNull Class<?> clazz, @NotNull @NotNull String[] methodNames, @NotNull @NotNull Class<?>... parameterTypes)
    • invokeMethod

      @Nullable public static <R> R invokeMethod(@NotNull @NotNull Method method, @Nullable @Nullable Object source, @Nullable @Nullable Object... parameters)
    • invokeMethod

      @Nullable public static <R> R invokeMethod(@NotNull @NotNull Class<R> returnType, @NotNull @NotNull Method method, @Nullable @Nullable Object source, @Nullable @Nullable Object... parameters)