Class FieldMemberHandle
java.lang.Object
com.cryptomorin.xseries.reflection.jvm.MemberHandle
com.cryptomorin.xseries.reflection.jvm.NamedMemberHandle
com.cryptomorin.xseries.reflection.jvm.FlaggedNamedMemberHandle
com.cryptomorin.xseries.reflection.jvm.FieldMemberHandle
- All Implemented Interfaces:
NamedReflectiveHandle,ReflectiveHandle<MethodHandle>,Cloneable
A handle for using reflection for
Field.-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Booleanstatic final MethodHandlestatic final MethodHandlestatic final DynamicClassHandleFields inherited from class com.cryptomorin.xseries.reflection.jvm.FlaggedNamedMemberHandle
isStatic, returnTypeFields inherited from class com.cryptomorin.xseries.reflection.jvm.NamedMemberHandle
namesFields inherited from class com.cryptomorin.xseries.reflection.jvm.MemberHandle
clazz, isFinal, makeAccessible -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionasFinal()asStatic()clone()Creates a new handle with the same properties.booleanexists()getter()protected <T extends AccessibleObject & Member>
ThandleAccessible(T field) Handles private/final declarations.If this member is known to be private or a final field.map(MinecraftMapping mapping, String name) reflect()The heart of the class.It's preferred to use one of theMethodHandlemethods instead.returns(ClassHandle clazz) setter()Changes the signature of this handle according to the given java code (seeReflectionParser) This overrides the current declaration, but names will be kept and any new names specified in the signature will also be added.toString()Methods inherited from class com.cryptomorin.xseries.reflection.jvm.FlaggedNamedMemberHandle
getParameters, getReturnTypeMethods inherited from class com.cryptomorin.xseries.reflection.jvm.NamedMemberHandle
getPossibleNamesMethods inherited from class com.cryptomorin.xseries.reflection.jvm.MemberHandle
getClassHandleMethods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.cryptomorin.xseries.reflection.ReflectiveHandle
catchError, reflectOrNull, unreflect
-
Field Details
-
MODIFIERS_FIELD
-
VarHandle
-
VAR_HANDLE_SET
-
getter
-
-
Constructor Details
-
FieldMemberHandle
-
-
Method Details
-
getter
-
asStatic
- Overrides:
asStaticin classFlaggedNamedMemberHandle
-
asFinal
-
makeAccessible
Description copied from class:MemberHandleIf this member is known to be private or a final field.- Overrides:
makeAccessiblein classMemberHandle
-
setter
-
returns
- Overrides:
returnsin classFlaggedNamedMemberHandle
-
returns
- Overrides:
returnsin classFlaggedNamedMemberHandle
-
clone
Description copied from interface:ReflectiveHandleCreates a new handle with the same properties.- Specified by:
clonein interfaceReflectiveHandle<MethodHandle>- Specified by:
clonein classNamedMemberHandle
-
reflect
Description copied from interface:ReflectiveHandleThe heart of the class.- Specified by:
reflectin interfaceReflectiveHandle<MethodHandle>- Specified by:
reflectin classMemberHandle- 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:
-
exists
public boolean exists()- Returns:
- true if this object exists at runtime, otherwise false.
-
signature
Description copied from class:MemberHandleChanges the signature of this handle according to the given java code (seeReflectionParser) This overrides the current declaration, but names will be kept and any new names specified in the signature will also be added.- Specified by:
signaturein classMemberHandle
-
map
public FieldMemberHandle map(MinecraftMapping mapping, @Pattern("\\p{javaJavaIdentifierStart}\\p{javaJavaIdentifierPart}*") String name) - Overrides:
mapin classNamedMemberHandle
-
named
public FieldMemberHandle named(@Pattern("\\p{javaJavaIdentifierStart}\\p{javaJavaIdentifierPart}*") String... names) - Overrides:
namedin classNamedMemberHandle
-
handleAccessible
protected <T extends AccessibleObject & Member> T handleAccessible(T field) throws ReflectiveOperationException Description copied from class:MemberHandleHandles private/final declarations.- Overrides:
handleAccessiblein classMemberHandle- Throws:
ReflectiveOperationException
-
reflectJvm
Description copied from class:MemberHandleIt's preferred to use one of theMethodHandlemethods instead. This method should only be used for special cases when a direct JVM object is needed.- Specified by:
reflectJvmin classMemberHandle- Throws:
ReflectiveOperationException- See Also:
-
toString
-