Uses of Interface
java.lang.constant.ClassDesc
Packages that use ClassDesc
Package
Description
Provides classes that are fundamental to the design of the Java
programming language.
Provides classfile parsing, generation, and transformation library.
Provides interfaces describing
class
file attributes for the java.lang.classfile
library.Provides interfaces describing constant pool entries for the
java.lang.classfile
library.Provides interfaces describing code instructions for the
java.lang.classfile
library.Classes and interfaces to represent nominal descriptors for run-time
entities such as classes or method handles, and classfile entities such as
constant pool entries or
invokedynamic
call sites.The
java.lang.invoke
package provides low-level primitives for interacting
with the Java Virtual Machine.-
Uses of ClassDesc in java.lang
Modifier and TypeMethodDescriptionClass.describeConstable()
Returns a nominal descriptor for this instance, if one can be constructed, or an emptyOptional
if one cannot be.Modifier and TypeMethodDescriptionstatic <E extends Enum<E>>
Enum.EnumDesc<E> Returns a nominal descriptor for the specifiedenum
class and name -
Uses of ClassDesc in java.lang.classfile
Methods in java.lang.classfile that return ClassDescModifier and TypeMethodDescriptiondefault ClassDesc
Signature.ClassTypeSig.classDesc()
Returns this class or interface, as a symbolic descriptor.default ClassDesc
Annotation.classSymbol()
Returns the annotation interface, as a symbolic descriptor.default ClassDesc
AnnotationValue.OfClass.classSymbol()
Returns the class descriptor.default ClassDesc
AnnotationValue.OfEnum.classSymbol()
Returns the enum class descriptor.default ClassDesc
FieldModel.fieldTypeSymbol()
Returns the field type, as a symbolic descriptor.TypeKind.upperBound()
Returns the most specific upper bound field descriptor that can store any value of this type.Methods in java.lang.classfile with parameters of type ClassDescModifier and TypeMethodDescriptiondefault CodeBuilder
Generates an instruction to create a new array ofreference
.default byte[]
ClassFile.build
(ClassDesc thisClass, Consumer<? super ClassBuilder> handler) Builds aclass
file into a byte array.default void
ClassFile.buildTo
(Path path, ClassDesc thisClass, Consumer<ClassBuilder> handler) Builds aclass
file into a file in a file system.CodeBuilder.CatchBuilder.catching
(ClassDesc exceptionType, Consumer<CodeBuilder.BlockCodeBuilder> catchHandler) Adds a catch block that catches an exception of the given type.default CodeBuilder
Generates an instruction to check whether an object is of the given type, throwing aClassCastException
if the check fails.default CodeBuilder
CodeBuilder.exceptionCatch
(Label start, Label end, Label handler, ClassDesc catchType) Declares an exception table entry.default CodeBuilder
CodeBuilder.fieldAccess
(Opcode opcode, ClassDesc owner, String name, ClassDesc type) Generates an instruction to access a field.ClassHierarchyResolver.getClassInfo
(ClassDesc classDesc) Returns theClassHierarchyInfo
for a given class name, ornull
if the name is unknown to the resolver.default CodeBuilder
Generates an instruction to fetch field from an object.default CodeBuilder
Generates an instruction to get static field from a class or interface.default CodeBuilder
CodeBuilder.instanceOf
(ClassDesc target) Generates an instruction to determine if an object is of the given type, producing aboolean
result on the operand stack.default CodeBuilder
CodeBuilder.invoke
(Opcode opcode, ClassDesc owner, String name, MethodTypeDesc desc, boolean isInterface) Generates an instruction to invoke a method.default CodeBuilder
CodeBuilder.invokeinterface
(ClassDesc owner, String name, MethodTypeDesc type) Generates an instruction to invoke an interface method.default CodeBuilder
CodeBuilder.invokespecial
(ClassDesc owner, String name, MethodTypeDesc type) Generates an instruction to invoke an instance method in a class; direct invocation of instance initialization methods and methods of the current class and its supertypes.default CodeBuilder
CodeBuilder.invokespecial
(ClassDesc owner, String name, MethodTypeDesc type, boolean isInterface) Generates an instruction to invoke an instance method; direct invocation of instance initialization methods and methods of the current class and its supertypes.default CodeBuilder
CodeBuilder.invokestatic
(ClassDesc owner, String name, MethodTypeDesc type) Generates an instruction to invoke a class (static) method of a class.default CodeBuilder
CodeBuilder.invokestatic
(ClassDesc owner, String name, MethodTypeDesc type, boolean isInterface) Generates an instruction to invoke a class (static) method.default CodeBuilder
CodeBuilder.invokevirtual
(ClassDesc owner, String name, MethodTypeDesc type) Generates an instruction to invoke an instance method; dispatch based on class.default CodeBuilder
CodeBuilder.localVariable
(int slot, String name, ClassDesc descriptor, Label startScope, Label endScope) Declares a local variable entry.default CodeBuilder
CodeBuilder.multianewarray
(ClassDesc array, int dims) Generates an instruction to create a new multidimensional array.default CodeBuilder
Generates an instruction to create a new object.static Annotation
Annotation.of
(ClassDesc annotationClass, AnnotationElement... elements) Returns an annotation.static Annotation
Annotation.of
(ClassDesc annotationClass, List<AnnotationElement> elements) Returns an annotation.static Signature.BaseTypeSig
Returns the signature of a primitive type or void.static Signature.ClassTypeSig
Signature.ClassTypeSig.of
(Signature.ClassTypeSig outerType, ClassDesc className, Signature.TypeArg... typeArgs) Returns a class or interface signature.static Signature.ClassTypeSig
Signature.ClassTypeSig.of
(ClassDesc className, Signature.TypeArg... typeArgs) Returns a class or interface signature without an outer type.static Signature
Returns a Java type signature from a field descriptor.static AnnotationElement
Returns an element-value pair for a class-valued element.static AnnotationValue.OfClass
Returns a class value for an element-value pair.Indicates that a class is a declared class, with the specific given super class.static AnnotationValue.OfEnum
Returns an enum value for an element-value pair.static Interfaces
Returns an Interfaces element.default CodeBuilder
Generates an instruction to set field in an object.default CodeBuilder
Generates an instruction to set static field in a class.default byte[]
ClassFile.transformClass
(ClassModel model, ClassDesc newClassName, ClassTransform transform) default ClassBuilder
Adds a field, with only access flags.default ClassBuilder
ClassBuilder.withField
(String name, ClassDesc descriptor, Consumer<? super FieldBuilder> handler) Adds a field.default ClassBuilder
ClassBuilder.withInterfaceSymbols
(ClassDesc... interfaces) Sets the interfaces of this class.default ClassBuilder
ClassBuilder.withSuperclass
(ClassDesc desc) Sets the superclass of this class.Method parameters in java.lang.classfile with type arguments of type ClassDescModifier and TypeMethodDescriptiondefault ClassHierarchyResolver
ClassHierarchyResolver.cached
(Supplier<Map<ClassDesc, ClassHierarchyResolver.ClassHierarchyInfo>> cacheFactory) Returns aClassHierarchyResolver
that caches class hierarchy information from this resolver.CodeBuilder.CatchBuilder.catchingMulti
(List<ClassDesc> exceptionTypes, Consumer<CodeBuilder.BlockCodeBuilder> catchHandler) Adds a catch block that catches exceptions of the given types.static ClassHierarchyResolver
ClassHierarchyResolver.of
(Collection<ClassDesc> interfaces, Map<ClassDesc, ClassDesc> classToSuperClass) Returns aClassHierarchyResolver
that extracts class hierarchy information from collections of class hierarchy metadata.static ClassHierarchyResolver
ClassHierarchyResolver.of
(Collection<ClassDesc> interfaces, Map<ClassDesc, ClassDesc> classToSuperClass) Returns aClassHierarchyResolver
that extracts class hierarchy information from collections of class hierarchy metadata.static ClassHierarchyResolver
ClassHierarchyResolver.of
(Collection<ClassDesc> interfaces, Map<ClassDesc, ClassDesc> classToSuperClass) Returns aClassHierarchyResolver
that extracts class hierarchy information from collections of class hierarchy metadata.static ClassHierarchyResolver
ClassHierarchyResolver.ofResourceParsing
(Function<ClassDesc, InputStream> classStreamResolver) Returns aClassHierarchyResolver
that extracts class hierarchy information fromclass
files returned by a mapping function.static Interfaces
Returns an Interfaces element.default ClassBuilder
ClassBuilder.withInterfaceSymbols
(List<ClassDesc> interfaces) Sets the interfaces of this class. -
Uses of ClassDesc in java.lang.classfile.attribute
Methods in java.lang.classfile.attribute that return ClassDescModifier and TypeMethodDescriptiondefault ClassDesc
StackMapFrameInfo.ObjectVerificationTypeInfo.classSymbol()
Returns the class of the object, as a symbolic descriptor.default ClassDesc
RecordComponentInfo.descriptorSymbol()
Returns the symbolic field descriptor of this component.default ClassDesc
LocalVariableInfo.typeSymbol()
Returns the field descriptor of the local variable.Methods in java.lang.classfile.attribute with parameters of type ClassDescModifier and TypeMethodDescriptionstatic EnclosingMethodAttribute
EnclosingMethodAttribute.of
(ClassDesc className, Optional<String> methodName, Optional<MethodTypeDesc> methodType) Returns anEnclosingMethod
attribute.static InnerClassInfo
InnerClassInfo.of
(ClassDesc innerClass, Optional<ClassDesc> outerClass, Optional<String> innerName, int flags) Returns a nested class description.static InnerClassInfo
InnerClassInfo.of
(ClassDesc innerClass, Optional<ClassDesc> outerClass, Optional<String> innerName, AccessFlag... flags) Returns a nested class description.static ModuleMainClassAttribute
Returns aModuleMainClass
attribute.static ModuleProvideInfo
Returns a service provision description.static ModuleProvideInfo
Returns a service provision description.static NestHostAttribute
Returns aNestHost
attribute.static RecordComponentInfo
Returns a record component description.static RecordComponentInfo
Returns a record component description.Returns a new object verification type info.static ExceptionsAttribute
Returns anExceptions
attribute.static NestMembersAttribute
Returns aNestMembers
attribute.static PermittedSubclassesAttribute
Returns aPermittedSubclasses
attribute.Declares provision of a service.Declares use of a service.Method parameters in java.lang.classfile.attribute with type arguments of type ClassDescModifier and TypeMethodDescriptionstatic InnerClassInfo
InnerClassInfo.of
(ClassDesc innerClass, Optional<ClassDesc> outerClass, Optional<String> innerName, int flags) Returns a nested class description.static InnerClassInfo
InnerClassInfo.of
(ClassDesc innerClass, Optional<ClassDesc> outerClass, Optional<String> innerName, AccessFlag... flags) Returns a nested class description.static ModuleProvideInfo
Returns a service provision description.static ExceptionsAttribute
Returns anExceptions
attribute.static NestMembersAttribute
Returns aNestMembers
attribute.static PermittedSubclassesAttribute
Returns aPermittedSubclasses
attribute. -
Uses of ClassDesc in java.lang.classfile.constantpool
Methods in java.lang.classfile.constantpool that return ClassDescModifier and TypeMethodDescriptionClassEntry.asSymbol()
Returns the represented reference type, as a symbolic descriptor.default ClassDesc
ConstantDynamicEntry.typeSymbol()
Returns a symbolic descriptor for the field type of this dynamically-computed constant.default ClassDesc
FieldRefEntry.typeSymbol()
Returns a symbolic descriptor for the field type.Methods in java.lang.classfile.constantpool with parameters of type ClassDescModifier and TypeMethodDescriptiondefault ClassEntry
ConstantPoolBuilder.classEntry
(ClassDesc classDesc) Returns aClassEntry
describing the same reference type as the providedClassDesc
.default FieldRefEntry
ConstantPoolBuilder.fieldRefEntry
(ClassDesc owner, String name, ClassDesc type) Returns aFieldRefEntry
describing a field of a class.default InterfaceMethodRefEntry
ConstantPoolBuilder.interfaceMethodRefEntry
(ClassDesc owner, String name, MethodTypeDesc type) Returns anInterfaceMethodRefEntry
describing a method of an interface.default MethodRefEntry
ConstantPoolBuilder.methodRefEntry
(ClassDesc owner, String name, MethodTypeDesc type) Returns aMethodRefEntry
describing a method of a class.default NameAndTypeEntry
ConstantPoolBuilder.nameAndTypeEntry
(String name, ClassDesc type) Returns aNameAndTypeEntry
describing the provided unqualified name and field descriptor.default Utf8Entry
-
Uses of ClassDesc in java.lang.classfile.instruction
Methods in java.lang.classfile.instruction that return ClassDescModifier and TypeMethodDescriptiondefault ClassDesc
FieldInstruction.typeSymbol()
Returns a symbolic descriptor for the type of the field.default ClassDesc
LocalVariable.typeSymbol()
Returns the local variable type, as a symbolic descriptor.Methods in java.lang.classfile.instruction with parameters of type ClassDescModifier and TypeMethodDescriptionstatic LocalVariable
Returns a local variable pseudo-instruction.static TypeCheckInstruction
Returns a type check instruction. -
Uses of ClassDesc in java.lang.constant
Subinterfaces with type arguments of type ClassDesc in java.lang.constantModifier and TypeInterfaceDescriptioninterface
A nominal descriptor for aClass
constant.interface
A nominal descriptor for a MethodType constant.Fields in java.lang.constant declared as ClassDescModifier and TypeFieldDescriptionstatic final ClassDesc
ConstantDescs.CD_boolean
ClassDesc
representing the primitive typeboolean
static final ClassDesc
ConstantDescs.CD_Boolean
static final ClassDesc
ConstantDescs.CD_byte
ClassDesc
representing the primitive typebyte
static final ClassDesc
ConstantDescs.CD_Byte
static final ClassDesc
ConstantDescs.CD_CallSite
static final ClassDesc
ConstantDescs.CD_char
ClassDesc
representing the primitive typechar
static final ClassDesc
ConstantDescs.CD_Character
static final ClassDesc
ConstantDescs.CD_Class
static final ClassDesc
ConstantDescs.CD_ClassDesc
static final ClassDesc
ConstantDescs.CD_Collection
ClassDesc
representingCollection
static final ClassDesc
ConstantDescs.CD_ConstantBootstraps
ClassDesc
representingConstantBootstraps
static final ClassDesc
ConstantDescs.CD_ConstantDesc
ClassDesc
representingConstantDesc
static final ClassDesc
ConstantDescs.CD_DirectMethodHandleDesc
ClassDesc
representingDirectMethodHandleDesc
static final ClassDesc
ConstantDescs.CD_double
ClassDesc
representing the primitive typedouble
static final ClassDesc
ConstantDescs.CD_Double
static final ClassDesc
ConstantDescs.CD_DynamicCallSiteDesc
ClassDesc
representingDynamicCallSiteDesc
static final ClassDesc
ConstantDescs.CD_DynamicConstantDesc
ClassDesc
representingDynamicConstantDesc
static final ClassDesc
ConstantDescs.CD_Enum
static final ClassDesc
ConstantDescs.CD_EnumDesc
ClassDesc
representingEnum.EnumDesc
static final ClassDesc
ConstantDescs.CD_Exception
static final ClassDesc
ConstantDescs.CD_float
ClassDesc
representing the primitive typefloat
static final ClassDesc
ConstantDescs.CD_Float
static final ClassDesc
ConstantDescs.CD_int
ClassDesc
representing the primitive typeint
static final ClassDesc
ConstantDescs.CD_Integer
static final ClassDesc
ConstantDescs.CD_List
static final ClassDesc
ConstantDescs.CD_long
ClassDesc
representing the primitive typelong
static final ClassDesc
ConstantDescs.CD_Long
static final ClassDesc
ConstantDescs.CD_Map
static final ClassDesc
ConstantDescs.CD_MethodHandle
ClassDesc
representingMethodHandle
static final ClassDesc
ConstantDescs.CD_MethodHandleDesc
ClassDesc
representingMethodHandleDesc
static final ClassDesc
ConstantDescs.CD_MethodHandleDesc_Kind
ClassDesc
representingDirectMethodHandleDesc.Kind
static final ClassDesc
ConstantDescs.CD_MethodHandles
ClassDesc
representingMethodHandles
static final ClassDesc
ConstantDescs.CD_MethodHandles_Lookup
ClassDesc
representingMethodHandles.Lookup
static final ClassDesc
ConstantDescs.CD_MethodType
ClassDesc
representingMethodType
static final ClassDesc
ConstantDescs.CD_MethodTypeDesc
ClassDesc
representingMethodTypeDesc
static final ClassDesc
ConstantDescs.CD_Number
static final ClassDesc
ConstantDescs.CD_Object
static final ClassDesc
ConstantDescs.CD_Set
static final ClassDesc
ConstantDescs.CD_short
ClassDesc
representing the primitive typeshort
static final ClassDesc
ConstantDescs.CD_Short
static final ClassDesc
ConstantDescs.CD_String
static final ClassDesc
ConstantDescs.CD_Throwable
static final ClassDesc
ConstantDescs.CD_VarHandle
static final ClassDesc
ConstantDescs.CD_VarHandleDesc
ClassDesc
representingVarHandle.VarHandleDesc
static final ClassDesc
ConstantDescs.CD_void
ClassDesc
representing the primitive typevoid
static final ClassDesc
ConstantDescs.CD_Void
Methods in java.lang.constant that return ClassDescModifier and TypeMethodDescriptionClassDesc.arrayType()
ClassDesc.arrayType
(int rank) default ClassDesc
ClassDesc.componentType()
Returns the component type of this ClassDesc, if it describes an array type, ornull
otherwise.DynamicConstantDesc.constantType()
Returns aClassDesc
describing the type that would appear in theNameAndType
operand of theLDC
for this constant.default ClassDesc
default ClassDesc
static ClassDesc
Returns a ClassDesc for a class or interface type, given the name of the class or interface, such as"java.lang.String"
.static ClassDesc
Returns a ClassDesc for a class or interface type, given a package name and the unqualified (simple) name for the class or interface.static ClassDesc
ClassDesc.ofDescriptor
(String descriptor) Returns a ClassDesc given a descriptor string for a class, interface, array, or primitive type.static ClassDesc
ClassDesc.ofInternalName
(String name) Returns a ClassDesc for a class or interface type, given the name of the class or interface in internal form, such as"java/lang/String"
.DirectMethodHandleDesc.owner()
Returns aClassDesc
describing the class declaring the method or field described by this nominal descriptor.MethodTypeDesc.parameterArray()
Returns the parameter types as an array.MethodTypeDesc.parameterType
(int index) Returns the parameter type of theindex
'th parameter of the method type described by this MethodTypeDesc.MethodTypeDesc.returnType()
Gets the return type of the method type described by this MethodTypeDesc.Methods in java.lang.constant that return types with arguments of type ClassDescModifier and TypeMethodDescriptionMethodTypeDesc.parameterList()
Returns the parameter types as an immutableList
.Methods in java.lang.constant with parameters of type ClassDescModifier and TypeMethodDescriptionMethodTypeDesc.changeParameterType
(int index, ClassDesc paramType) Returns a MethodTypeDesc that is identical to this one, except that a single parameter type has been changed to the specified type.MethodTypeDesc.changeReturnType
(ClassDesc returnType) Returns a MethodTypeDesc that is identical to this one, except with the specified return type.MethodTypeDesc.insertParameterTypes
(int pos, ClassDesc... paramTypes) Returns a MethodTypeDesc that is identical to this one, except that a range of additional parameter types have been inserted.static DirectMethodHandleDesc
MethodHandleDesc.of
(DirectMethodHandleDesc.Kind kind, ClassDesc owner, String name, String lookupDescriptor) Creates a MethodHandleDesc corresponding to an invocation of a declared method, invocation of a constructor, or access to a field.static MethodTypeDesc
Returns a MethodTypeDesc with the given return type and no parameter types.static MethodTypeDesc
Returns a MethodTypeDesc given the return type and parameter types.static MethodTypeDesc
Returns a MethodTypeDesc given the return type and a list of parameter types.static DirectMethodHandleDesc
ConstantDescs.ofCallsiteBootstrap
(ClassDesc owner, String name, ClassDesc returnType, ClassDesc... paramTypes) Returns aMethodHandleDesc
corresponding to a bootstrap method for aninvokedynamic
callsite, which is a static method whose leading parameter types areLookup
,String
, andMethodType
.static <T> ConstantDesc
DynamicConstantDesc.ofCanonical
(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 DirectMethodHandleDesc
ConstantDescs.ofConstantBootstrap
(ClassDesc owner, String name, ClassDesc returnType, ClassDesc... paramTypes) Returns aMethodHandleDesc
corresponding to a bootstrap method for a dynamic constant, which is a static method whose leading arguments areLookup
,String
, andClass
.static DirectMethodHandleDesc
MethodHandleDesc.ofConstructor
(ClassDesc owner, ClassDesc... paramTypes) Returns a MethodHandleDesc corresponding to invocation of a constructorstatic DirectMethodHandleDesc
MethodHandleDesc.ofField
(DirectMethodHandleDesc.Kind kind, ClassDesc owner, String fieldName, ClassDesc fieldType) Creates a MethodHandleDesc corresponding to a method handle that accesses a field.static DirectMethodHandleDesc
MethodHandleDesc.ofMethod
(DirectMethodHandleDesc.Kind kind, ClassDesc owner, String name, MethodTypeDesc lookupMethodType) Creates a MethodHandleDesc corresponding to an invocation of a declared method or constructor.static <T> DynamicConstantDesc
<T> DynamicConstantDesc.ofNamed
(DirectMethodHandleDesc bootstrapMethod, String constantName, ClassDesc constantType, ConstantDesc... bootstrapArgs) Returns a nominal descriptor for a dynamic constant.Method parameters in java.lang.constant with type arguments of type ClassDescModifier and TypeMethodDescriptionstatic MethodTypeDesc
Returns a MethodTypeDesc given the return type and a list of parameter types.Constructors in java.lang.constant with parameters of type ClassDescModifierConstructorDescriptionprotected
DynamicConstantDesc
(DirectMethodHandleDesc bootstrapMethod, String constantName, ClassDesc constantType, ConstantDesc... bootstrapArgs) Creates a nominal descriptor for a dynamic constant. -
Uses of ClassDesc in java.lang.invoke
Methods in java.lang.invoke that return ClassDescModifier and TypeMethodDescriptionVarHandle.VarHandleDesc.varType()
Returns aClassDesc
describing the type of the variable described by this descriptor.Methods in java.lang.invoke with parameters of type ClassDescModifier and TypeMethodDescriptionstatic VarHandle.VarHandleDesc
Returns a VarHandle.VarHandleDesc corresponding to aVarHandle
for an array type.static VarHandle.VarHandleDesc
Returns a VarHandle.VarHandleDesc corresponding to aVarHandle
for an instance field.static VarHandle.VarHandleDesc
VarHandle.VarHandleDesc.ofStaticField
(ClassDesc declaringClass, String name, ClassDesc fieldType) Returns a VarHandle.VarHandleDesc corresponding to aVarHandle
for a static field.