java.lang.Object
com.cryptomorin.xseries.reflection.jvm.classes.ClassHandle
All Implemented Interfaces:
NamedReflectiveHandle, ReflectiveHandle<Class<?>>
Direct Known Subclasses:
DynamicClassHandle, StaticClassHandle, UnknownClassHandle

public abstract class ClassHandle extends Object implements ReflectiveHandle<Class<?>>, NamedReflectiveHandle
See Also:
  • Field Details

  • Constructor Details

  • Method Details

    • constraint

      @Experimental @Contract(value="_ -> this", mutates="this") public ClassHandle constraint(@NotNull @NotNull ReflectiveConstraint constraint)
      Since:
      12.0.0
    • checkConstraints

      protected <T extends Class<?>> T checkConstraints(T jvm)
    • asArray

      @NotNull @Contract("_ -> new") public abstract @NotNull ClassHandle asArray(@org.jetbrains.annotations.Range(from=1L, to=2147483647L) int dimensions)
    • asArray

      @NotNull @Contract("-> new") public final @NotNull ClassHandle asArray()
    • isArray

      @Contract(pure=true) public abstract boolean isArray()
    • inner

      @NotNull @Contract("_ -> new") public @NotNull DynamicClassHandle inner(@Language(value="Java",suffix="{}") String declaration)
    • inner

      @NotNull @Contract("_ -> param1") public <T extends DynamicClassHandle> T inner(@NotNull T handle)
      Type Parameters:
      T - the type of the class handle.
      Parameters:
      handle - the handle to put the inner class information in.
      Returns:
      the same object as the one provided in the parameter.
    • getDimensionCount

      public @org.jetbrains.annotations.Range(from=-1L, to=2147483647L) int getDimensionCount()
      The array dimension of this class.
      Returns:
      -1 if this class cannot be found, 0 if not an array, otherwise a positive number.
    • getNamespace

      @Contract(pure=true) public ReflectiveNamespace getNamespace()
    • method

      @Contract(value="-> new", pure=true) public MethodMemberHandle method()
    • method

      @Contract(value="_ -> new", pure=true) public MethodMemberHandle method(@Language(value="Java",suffix=";") String declaration)
    • enums

      @Contract(value="-> new", pure=true) public EnumMemberHandle enums()
    • field

      @Contract(value="-> new", pure=true) public FieldMemberHandle field()
    • field

      @Contract(value="_ -> new", pure=true) public FieldMemberHandle field(@Language(value="Java",suffix=";") String declaration)
    • constructor

      @Contract(value="_ -> new", pure=true) public ConstructorMemberHandle constructor(@Language(value="Java",suffix=";") String declaration)
    • constructor

      @Contract(value="-> new", pure=true) public ConstructorMemberHandle constructor()
    • constructor

      @Contract(value="_ -> new", pure=true) public ConstructorMemberHandle constructor(Class<?>... parameters)
    • constructor

      @Contract(value="_ -> new", pure=true) public ConstructorMemberHandle constructor(ClassHandle... parameters)
    • copy

      public abstract ClassHandle copy()
      Description copied from interface: ReflectiveHandle
      Creates a new handle with the same properties.
      Specified by:
      copy in interface ReflectiveHandle<Class<?>>
    • jvm

      @NotNull public @NotNull ReflectiveHandle<ReflectedObject> jvm()
      Description copied from interface: ReflectiveHandle
      Usually ReflectiveHandles return MethodHandle when possible, however this method returns the raw object using the traditional Java reflection API which can be:
      Specified by:
      jvm in interface ReflectiveHandle<Class<?>>
      See Also: