ConstantDesc
public static final class VarHandle.VarHandleDesc extends DynamicConstantDesc<VarHandle>
VarHandle
constant.Modifier and Type | Method | Description |
---|---|---|
static VarHandle.VarHandleDesc |
ofArray(ClassDesc arrayClass) |
Returns a VarHandle.VarHandleDesc corresponding to a
VarHandle
for for an array type. |
static VarHandle.VarHandleDesc |
ofField(ClassDesc declaringClass,
String name,
ClassDesc fieldType) |
Returns a VarHandle.VarHandleDesc corresponding to a
VarHandle
for an instance field. |
static VarHandle.VarHandleDesc |
ofStaticField(ClassDesc declaringClass,
String name,
ClassDesc fieldType) |
Returns a VarHandle.VarHandleDesc corresponding to a
VarHandle
for a static field. |
VarHandle |
resolveConstantDesc(MethodHandles.Lookup lookup) |
Resolve this descriptor reflectively, emulating the resolution behavior
of JVMS 5.4.3 and the access control behavior of JVMS 5.4.4.
|
String |
toString() |
Returns a string representation of the object.
|
ClassDesc |
varType() |
Returns a
ClassDesc describing the type of the variable described
by this descriptor. |
bootstrapArgs, bootstrapArgsList, bootstrapMethod, constantName, constantType, equals, hashCode, of, of, ofCanonical, ofNamed
public static VarHandle.VarHandleDesc ofField(ClassDesc declaringClass, String name, ClassDesc fieldType)
VarHandle
for an instance field.name
- the unqualifed name of the fielddeclaringClass
- a ClassDesc
describing the declaring class,
for field var handlesfieldType
- a ClassDesc
describing the type of the fieldNullPointerException
- if any of the arguments are nullpublic static VarHandle.VarHandleDesc ofStaticField(ClassDesc declaringClass, String name, ClassDesc fieldType)
VarHandle
for a static field.name
- the unqualified name of the fielddeclaringClass
- a ClassDesc
describing the declaring class,
for field var handlesfieldType
- a ClassDesc
describing the type of the fieldNullPointerException
- if any of the arguments are nullpublic static VarHandle.VarHandleDesc ofArray(ClassDesc arrayClass)
VarHandle
for for an array type.arrayClass
- a ClassDesc
describing the type of the arrayNullPointerException
- if any of the arguments are nullpublic ClassDesc varType()
ClassDesc
describing the type of the variable described
by this descriptor.public VarHandle resolveConstantDesc(MethodHandles.Lookup lookup) throws ReflectiveOperationException
ConstantDesc
MethodHandles.Lookup
parameter. No caching of the resulting value is performed.resolveConstantDesc
in interface ConstantDesc
resolveConstantDesc
in class DynamicConstantDesc<VarHandle>
lookup
- The MethodHandles.Lookup
to provide name resolution
and access control contextReflectiveOperationException
- if a class, method, or field
could not be reflectively resolved in the course of resolutionpublic String toString()
Object
toString
method returns a string that
"textually represents" this object. The result should
be a concise but informative representation that is easy for a
person to read.
It is recommended that all subclasses override this method.
The toString
method for class Object
returns a string consisting of the name of the class of which the
object is an instance, the at-sign character `@
', and
the unsigned hexadecimal representation of the hash code of the
object. In other words, this method returns a string equal to the
value of:
getClass().getName() + '@' + Integer.toHexString(hashCode())
toString
in class DynamicConstantDesc<VarHandle>