Class ClassHandle
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 Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal @NotNull ClassHandleasArray()abstract @NotNull ClassHandleasArray(@org.jetbrains.annotations.Range(from=1L, to=2147483647L) int dimensions) protected <T extends Class<?>>
TcheckConstraints(T jvm) constraint(@NotNull ReflectiveConstraint constraint) constructor(ClassHandle... parameters) constructor(Class<?>... parameters) constructor(String declaration) abstract ClassHandlecopy()Creates a new handle with the same properties.enums()field()@org.jetbrains.annotations.Range(from=-1L, to=2147483647L) intThe array dimension of this class.@NotNull DynamicClassHandle<T extends DynamicClassHandle>
Tinner(T handle) abstract booleanisArray()@NotNull ReflectiveHandle<ReflectedObject> jvm()UsuallyReflectiveHandles returnMethodHandlewhen possible, however this method returns the raw object using the traditional Java reflection API which can be:FieldMethodConstructorClass (same as its normal ReflectiveHandle)method()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.cryptomorin.xseries.reflection.jvm.NamedReflectiveHandle
getPossibleNamesMethods inherited from interface com.cryptomorin.xseries.reflection.ReflectiveHandle
cached, catchError, exists, reflect, reflectOrNull, unreflect, unwrap
-
Field Details
-
namespace
-
-
Constructor Details
-
ClassHandle
-
-
Method Details
-
constraint
@Experimental @Contract(value="_ -> this", mutates="this") public ClassHandle constraint(@NotNull @NotNull ReflectiveConstraint constraint) - Since:
- 12.0.0
-
checkConstraints
-
asArray
@NotNull @Contract("_ -> new") public abstract @NotNull ClassHandle asArray(@org.jetbrains.annotations.Range(from=1L, to=2147483647L) int dimensions) -
asArray
-
isArray
@Contract(pure=true) public abstract boolean isArray() -
inner
@NotNull @Contract("_ -> new") public @NotNull DynamicClassHandle inner(@Language(value="Java",suffix="{}") String declaration) -
inner
- 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
-
method
-
method
@Contract(value="_ -> new", pure=true) public MethodMemberHandle method(@Language(value="Java",suffix=";") String declaration) -
enums
-
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
-
constructor
@Contract(value="_ -> new", pure=true) public ConstructorMemberHandle constructor(Class<?>... parameters) -
constructor
@Contract(value="_ -> new", pure=true) public ConstructorMemberHandle constructor(ClassHandle... parameters) -
copy
Description copied from interface:ReflectiveHandleCreates a new handle with the same properties.- Specified by:
copyin interfaceReflectiveHandle<Class<?>>
-
jvm
Description copied from interface:ReflectiveHandleUsuallyReflectiveHandles returnMethodHandlewhen possible, however this method returns the raw object using the traditional Java reflection API which can be:- Specified by:
jvmin interfaceReflectiveHandle<Class<?>>- See Also:
-