- All Implemented Interfaces:
- ConstantDesc
- Enclosing class:
- VarHandle
A nominal descriptor for a
 
VarHandle constant.- Since:
- 12
- 
Method SummaryModifier 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 java.lang.constant.DynamicConstantDescbootstrapArgs, bootstrapArgsList, bootstrapMethod, constantName, constantType, equals, hashCode, of, of, ofCanonical, ofNamed, resolveConstantDesc
- 
Method Details- 
ofFieldpublic static VarHandle.VarHandleDesc ofField(ClassDesc declaringClass, String name, ClassDesc fieldType) Returns a VarHandle.VarHandleDesc corresponding to aVarHandlefor an instance field.- Parameters:
- declaringClass- a- ClassDescdescribing the declaring class, for field var handles
- name- the unqualified name of the field
- fieldType- a- ClassDescdescribing 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
 
- 
ofStaticFieldpublic static VarHandle.VarHandleDesc ofStaticField(ClassDesc declaringClass, String name, ClassDesc fieldType) Returns a VarHandle.VarHandleDesc corresponding to aVarHandlefor a static field.- Parameters:
- declaringClass- a- ClassDescdescribing the declaring class, for field var handles
- name- the unqualified name of the field
- fieldType- a- ClassDescdescribing 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
 
- 
ofArrayReturns a VarHandle.VarHandleDesc corresponding to aVarHandlefor an array type.- Parameters:
- arrayClass- a- ClassDescdescribing the type of the array
- Returns:
- the VarHandle.VarHandleDesc
- Throws:
- NullPointerException- if any of the arguments are null
 
- 
varTypeReturns aClassDescdescribing the type of the variable described by this descriptor.- Returns:
- the variable type
 
- 
toStringReturns 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 class- DynamicConstantDesc<VarHandle>
- Returns:
- A compact textual description of this descriptor
 
 
-