Interface ReflectiveHandle<T>
- Type Parameters:
T- The JVM type associated with this handle (e.g.Class,Field,Method, orConstructor)
- All Known Implementing Classes:
AggregateReflectiveHandle,ClassHandle,ConstructorMemberHandle,DynamicClassHandle,EnumMemberHandle,FieldMemberHandle,FlaggedNamedMemberHandle,MemberHandle,MethodMemberHandle,MinecraftClassHandle,NamedMemberHandle,StaticClassHandle
public interface ReflectiveHandle<T>
Represents an object that can be used for reflection operations.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptiondefault @Nullable ReflectiveOperationExceptionCatches anyReflectiveOperationExceptionthrown byreflect()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
-
exists
default boolean exists()- Returns:
- true if this object exists at runtime, otherwise false.
-
catchError
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:
-