Class VarHandle.VarHandleDesc
- All Implemented Interfaces:
ConstantDesc
- Enclosing class:
VarHandle
A nominal descriptor for a
VarHandle constant.- Since:
- 12
-
Method Summary
Modifier and TypeMethodDescriptionstatic VarHandle.VarHandleDescReturns a VarHandle.VarHandleDesc corresponding to aVarHandlefor an array type.static VarHandle.VarHandleDescReturns a VarHandle.VarHandleDesc corresponding to aVarHandlefor an instance field.static VarHandle.VarHandleDescofStaticField(ClassDesc declaringClass, String name, ClassDesc fieldType) Returns a VarHandle.VarHandleDesc corresponding to aVarHandlefor a static field.toString()Returns a compact textual description of this constant description.varType()Returns aClassDescdescribing the type of the variable described by this descriptor.Methods declared in class DynamicConstantDesc
bootstrapArgs, bootstrapArgsList, bootstrapMethod, constantName, constantType, equals, hashCode, of, of, ofCanonical, ofNamed, resolveConstantDescModifier and TypeMethodDescriptionReturns the bootstrap arguments for this constant.Returns the bootstrap arguments for this constant as an immutableList.Returns aMethodHandleDescdescribing the bootstrap method for this constant.Returns the name that would appear in theNameAndTypeoperand of theLDCfor this constant.Returns aClassDescdescribing the type that would appear in theNameAndTypeoperand of theLDCfor this constant.final booleanCompares the specified object with this descriptor for equality.final inthashCode()Answers an integer hash code for the receiver.static <T> DynamicConstantDesc<T> of(DirectMethodHandleDesc bootstrapMethod) Returns a nominal descriptor for a dynamic constant whose bootstrap has no static arguments, whose name parameter isConstantDescs.DEFAULT_NAME, and whose type parameter is always the same as the bootstrap method return type.static <T> DynamicConstantDesc<T> of(DirectMethodHandleDesc bootstrapMethod, ConstantDesc... bootstrapArgs) Returns a nominal descriptor for a dynamic constant whose name parameter isConstantDescs.DEFAULT_NAME, and whose type parameter is always the same as the bootstrap method return type.static <T> ConstantDescofCanonical(DirectMethodHandleDesc bootstrapMethod, String constantName, ClassDesc constantType, ConstantDesc[] bootstrapArgs) Returns a nominal descriptor for a dynamic constant, transforming it into a more specific type if the constant bootstrap is a well-known one and a more specific nominal descriptor type (e.g., ClassDesc) is available.static <T> DynamicConstantDesc<T> ofNamed(DirectMethodHandleDesc bootstrapMethod, String constantName, ClassDesc constantType, ConstantDesc... bootstrapArgs) Returns a nominal descriptor for a dynamic constant.Methods declared in class Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitModifier and TypeMethodDescriptionprotected Objectclone()Answers a new instance of the same class as the receiver, whose slots have been filled in with the values in the slots of the receiver.protected voidfinalize()Deprecated, for removal: This API element is subject to removal in a future version.May cause performance issues, deadlocks and hangs.getClass()Answers the unique instance of java.lang.Class which represents the class of the receiver.final voidnotify()Causes one thread which iswaiting on the receiver to be made ready to run.final voidCauses all threads which arewaiting on the receiver to be made ready to run.final voidwait()Causes the thread which sent this message to be made not ready to run pending some change in the receiver (as indicated bynotifyornotifyAll).final voidwait(long time) Causes the thread which sent this message to be made not ready to run either pending some change in the receiver (as indicated bynotifyornotifyAll) or the expiration of the timeout.final voidwait(long time, int frac) Causes the thread which sent this message to be made not ready to run either pending some change in the receiver (as indicated bynotifyornotifyAll) or the expiration of the timeout.
-
Method Details
-
ofField
public static VarHandle.VarHandleDesc ofField(ClassDesc declaringClass, String name, ClassDesc fieldType) Returns a VarHandle.VarHandleDesc corresponding to aVarHandlefor an instance field.- Parameters:
declaringClass- aClassDescdescribing the declaring class, for field var handlesname- the unqualified name of the fieldfieldType- aClassDescdescribing the type of the field- Returns:
- the VarHandle.VarHandleDesc
- Throws:
NullPointerException- if any of the arguments are null- See Java Virtual Machine Specification:
-
4.2.2 Unqualified Names
-
ofStaticField
public static VarHandle.VarHandleDesc ofStaticField(ClassDesc declaringClass, String name, ClassDesc fieldType) Returns a VarHandle.VarHandleDesc corresponding to aVarHandlefor a static field.- Parameters:
declaringClass- aClassDescdescribing the declaring class, for field var handlesname- the unqualified name of the fieldfieldType- aClassDescdescribing the type of the field- Returns:
- the VarHandle.VarHandleDesc
- Throws:
NullPointerException- if any of the arguments are null- See Java Virtual Machine Specification:
-
4.2.2 Unqualified Names
-
ofArray
Returns a VarHandle.VarHandleDesc corresponding to aVarHandlefor an array type.- Parameters:
arrayClass- aClassDescdescribing the type of the array- Returns:
- the VarHandle.VarHandleDesc
- Throws:
NullPointerException- if any of the arguments are null
-
varType
-
toString
Returns a compact textual description of this constant description. For a field VarHandle, includes the owner, name, and type of the field, and whether it is static; for an array VarHandle, the name of the component type.- Overrides:
toStringin classDynamicConstantDesc<VarHandle>- Returns:
- A compact textual description of this descriptor
-