- java.lang.Object
-
- java.lang.constant.DynamicConstantDesc<VarHandle>
-
- java.lang.invoke.VarHandle.VarHandleDesc
-
- All Implemented Interfaces:
ConstantDesc
- Enclosing class:
- VarHandle
public static final class VarHandle.VarHandleDesc extends DynamicConstantDesc<VarHandle>
A nominal descriptor for aVarHandleconstant.- Since:
- 12
-
-
Method Summary
Modifier and Type Method Description static VarHandle.VarHandleDescofArray(ClassDesc arrayClass)Returns a VarHandle.VarHandleDesc corresponding to aVarHandlefor for an array type.static VarHandle.VarHandleDescofField(ClassDesc declaringClass, String name, ClassDesc fieldType)Returns 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.StringtoString()Returns a compact textual description of this constant description.ClassDescvarType()Returns aClassDescdescribing the type of the variable described by this descriptor.-
Methods declared in class java.lang.constant.DynamicConstantDesc
bootstrapArgs, bootstrapArgsList, bootstrapMethod, constantName, constantType, equals, of, of, ofCanonical, ofNamed
-
Methods declared in class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods declared in interface java.lang.constant.ConstantDesc
resolveConstantDesc
-
-
-
-
Method Detail
-
ofField
public static VarHandle.VarHandleDesc ofField(ClassDesc declaringClass, String name, ClassDesc fieldType)
Returns a VarHandle.VarHandleDesc corresponding to aVarHandlefor an instance field.- Parameters:
name- the unqualifed name of the fielddeclaringClass- aClassDescdescribing the declaring class, for field var handlesfieldType- aClassDescdescribing the type of the field- Returns:
- the VarHandle.VarHandleDesc
- Throws:
NullPointerException- if any of the arguments are null- See The 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:
name- the unqualified name of the fielddeclaringClass- aClassDescdescribing the declaring class, for field var handlesfieldType- aClassDescdescribing the type of the field- Returns:
- the VarHandle.VarHandleDesc
- Throws:
NullPointerException- if any of the arguments are null- See The Java™ Virtual Machine Specification:
- 4.2.2 Unqualified Names
-
ofArray
public static VarHandle.VarHandleDesc ofArray(ClassDesc arrayClass)
Returns a VarHandle.VarHandleDesc corresponding to aVarHandlefor for 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
public ClassDesc varType()
Returns aClassDescdescribing the type of the variable described by this descriptor.- Returns:
- the variable type
-
toString
public String 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
-
-