Interface ReflectiveHandle<T>
- Type Parameters:
T- The JVM type associated with this handle (e.g.Class,Field,Method, orConstructor)
- All Superinterfaces:
Cloneable
- All Known Implementing Classes:
AggregateReflectiveHandle,ClassHandle,ConstructorMemberHandle,DynamicClassHandle,EnumMemberHandle,FieldMemberHandle,FlaggedNamedMemberHandle,MemberHandle,MethodMemberHandle,MinecraftClassHandle,NamedMemberHandle,StaticClassHandle,UnknownClassHandle
Represents an object that can be used for reflection operations.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptiondefault @Nullable ReflectiveOperationExceptionDeprecated.I don't think there's going to be any practical use for this method.clone()Creates a new handle with the same properties.default booleanexists()reflect()The heart of the class.default TSame asreflect()except that it will return null if anyReflectiveOperationExceptionerrors occur.default TAn unchecked exception version ofreflect()(throws the original exception, not the aRuntimeException)
-
Method Details
-
clone
Creates a new handle with the same properties. -
exists
default boolean exists()- Returns:
- true if this object exists at runtime, otherwise false.
-
catchError
Deprecated.I don't think there's going to be any practical use for this method.Catches anyReflectiveOperationExceptionthrown byreflect() -
unreflect
An unchecked exception version ofreflect()(throws the original exception, not the aRuntimeException)- Throws:
ReflectiveOperationException- throws silently.- See Also:
-
reflectOrNull
Same asreflect()except that it will return null if anyReflectiveOperationExceptionerrors occur.- See Also:
-
reflect
The heart of the class.- Returns:
- the final JVM object that exists in this runtime.
- Throws:
ReflectiveOperationException- if any errors occur while getting the object, including unknown objects, security issues, etc...- See Also:
-