Package Summary  Overview Summary

class:VarHandle.VarHandleDesc [NONE]

All Implemented Interfaces:
ConstantDesc
Enclosing class:
VarHandle

public static final class VarHandle.VarHandleDesc
extends DynamicConstantDesc<VarHandle>
A nominal descriptor for a VarHandle constant.
Since:
12

method:ofField(java.lang.constant.ClassDesc,java.lang.String,java.lang.constant.ClassDesc) [NONE]

  • ofField

    public static  VarHandle.VarHandleDesc ofField?(ClassDesc declaringClass, String name, ClassDesc fieldType)
    Returns a VarHandle.VarHandleDesc corresponding to a VarHandle for an instance field.
    Parameters:
    name - the unqualifed name of the field
    declaringClass - a ClassDesc describing the declaring class, for field var handles
    fieldType - a ClassDesc describing the type of the field
    Returns:
    the VarHandle.VarHandleDesc
    Throws:
    NullPointerException - if any of the arguments are null
  • method:ofStaticField(java.lang.constant.ClassDesc,java.lang.String,java.lang.constant.ClassDesc) [NONE]

    ofStaticField

    public static  VarHandle.VarHandleDesc ofStaticField?(ClassDesc declaringClass, String name, ClassDesc fieldType)
    Returns a VarHandle.VarHandleDesc corresponding to a VarHandle for a static field.
    Parameters:
    name - the unqualified name of the field
    declaringClass - a ClassDesc describing the declaring class, for field var handles
    fieldType - a ClassDesc describing the type of the field
    Returns:
    the VarHandle.VarHandleDesc
    Throws:
    NullPointerException - if any of the arguments are null

    method:ofArray(java.lang.constant.ClassDesc) [NONE]

    ofArray

    public static  VarHandle.VarHandleDesc ofArray?(ClassDesc arrayClass)
    Returns a VarHandle.VarHandleDesc corresponding to a VarHandle for an array type.
    Parameters:
    arrayClass - a ClassDesc describing the type of the array
    Returns:
    the VarHandle.VarHandleDesc
    Throws:
    NullPointerException - if any of the arguments are null

    method:varType() [NONE]

    varType

    public ClassDesc varType()
    Returns a ClassDesc describing the type of the variable described by this descriptor.
    Returns:
    the variable type

    method:resolveConstantDesc(java.lang.invoke.MethodHandles.Lookup) [NONE]

    resolveConstantDesc

    public VarHandle resolveConstantDesc?(MethodHandles.Lookup lookup) throws ReflectiveOperationException
    Description copied from interface: ConstantDesc
    Resolves this descriptor reflectively, emulating the resolution behavior of JVMS 5.4.3 and the access control behavior of JVMS 5.4.4. The resolution and access control context is provided by the MethodHandles.Lookup parameter. No caching of the resulting value is performed.
    Specified by:
    resolveConstantDesc in interface ConstantDesc
    Overrides:
    resolveConstantDesc in class DynamicConstantDesc<VarHandle>
    Parameters:
    lookup - The MethodHandles.Lookup to provide name resolution and access control context
    Returns:
    the resolved constant value
    Throws:
    ReflectiveOperationException - if a class, method, or field could not be reflectively resolved in the course of resolution

    method:toString() [NONE]

    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:
    toString in class DynamicConstantDesc<VarHandle>
    Returns:
    A compact textual description of this descriptor