Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8308754

Class-File API (Preview)

XMLWordPrintable

    • source
    • minimal
    • Class-File API introduces new set of classes in new packages.
    • Java API
    • SE

      Summary

      Provide a standard API for parsing, generating, and transforming Java class files. This is a preview API.

      Problem

      Class-file generation, parsing, and instrumentation is ubiquitous in the Java ecosystem. Many tools and libraries process class files, and frameworks often perform on-the-fly bytecode instrumentation, transformation, and generation.

      The Java ecosystem has many different libraries for class-file parsing and generation, each with different design goals, strengths and weaknesses. In the last decade the JDK has made extensive use of the [ASM] library in its implementation, for tasks such as lambda proxy generation. However, there are a number of reasons why it makes sense for the JDK to include its own authoritative class-file library.

      • JVM evolution — The JVM and the class-file format are evolving much faster now than in the early years of the platform. While some evolutions are simple, for example adding new attributes such as NestMembers, others are more complex. Project Valhalla, for example, will bring new bytecodes and field descriptors. At some point it may become prohibitively expensive to evolve existing libraries to support these new features. A JDK class-file library can evolve with the class-file format, reducing the friction of implementing and testing new class-file features.

      • JDK consolidation — The JDK itself is a significant dealer in class files. For historical reasons it contains four distinct internal class-file libraries:

        • A custom library in the jdk.compiler module, used by the javac compiler and the javadoc tool;

        • Another custom library in the jdk.jdeps module, used by the javap, jdeps, jdeprscan, and jlink tools;

        • A fork of BCEL in the java.xml module, used in a fork of Xalan; and

        • A fork of [ASM] in the java.base module, used in the implementation of lambdas, method handles, modules, dynamic proxies, JFR, and the jar, jimage, jlink, and jshell tools.

        In the case of ASM, using it to implement fundamental elements of the platform imposes a delay on the use of new class-file features. The ASM version for JDK N cannot finalize until JDK N finalizes, hence JDK tools such as jlink cannot process class-file features that are new in JDK N, hence javac cannot generate class-file features that are new in JDK N until JDK N+1. JDK developers need a class-file library that is kept up-to-date with the JVM.

      • Version skew between frameworks and the running JDK — Applications which use frameworks that process class files generally bundle a class-file library. But new class-file features can appear in any JDK release, and the rate of JDK releases accelerated substantially after JDK 9, so applications are more frequently encountering class files that are newer than the library that they bundle. This results in runtime errors or, worse, frameworks trying to parse class files from the future and engaging in leaps of faith that nothing too serious has changed. Application and framework developers need a class-file library that they can count on to be up-to-date with the running JDK.

      • Language improvements — An obvious idea is to "just" merge ASM into the JDK and take on responsibility for its ongoing maintenance, but this is not the right choice. ASM is an old code base with a lot of legacy baggage, it is difficult to evolve, and the design priorities that informed its architecture are likely not what we would choose today. Moreover, the Java language has improved substantially since ASM was created, so what might have been the best API idioms in 2002 may not be ideal two decades later.

      Solution

      Class-file API as an integral part of java.base module aims to address the issues. We have adopted the following design goals and principles for the API.

      • Class-file entities are represented by immutable objects — All class-file entities, such as methods, fields, attributes, instructions, annotations, etc., are represented by immutable objects. This facilitates reliable sharing when a class file is being transformed.

      • Tree-structured representation — A class file has a tree structure. A class has some metadata (name, supertype, etc.), and a variable number of fields, methods, and attributes. Fields and methods themselves have metadata and further contain attributes, including the Code attribute. The Code attribute further contains instructions, exception handlers, and so forth. The API for navigating and building class files should reflect this structure.

      • User-driven navigation — The path we take through the class-file tree is driven by user choices. If the user cares only about annotations on fields then we should only have to parse as far down as the annotation attributes inside the field_info structure; we should not have to look into any of the class attributes or the bodies of methods, or at other attributes of the field. Users should be able to deal with compound entities, such as methods, either as single units or broken into streams of their constituent parts, as desired.

      • Laziness — User-driven navigation enables significant efficiencies, such as not parsing any more of the class file than is required to satisfy the user's needs. If the user is not going to dive into the contents of a method then we need not parse any more of the method_info structure than is needed to figure out where the next class-file element starts. We can lazily inflate, and cache, the full representation when the user asks for it.

      • Unified streaming and materialized views — Like ASM, we want to support both a streaming and a materialized view of a class file. The streaming view is suitable for the majority of use cases, while the materialized view is more general since it allows random access. We can provide a materialized view far less expensively than ASM through laziness, as enabled by immutability. We can, further, align the streaming and materialized views so that they use a common vocabulary and can be used in coordination, as is convenient for each use case.

      • Emergent transformation — If the class-file reading and writing APIs are sufficiently aligned then transformation can be an emergent property that does not require its own special mode or significant new API surface. (ASM achieves this by using a common visitor structure for readers and writers.) If classes, methods, fields, and code bodies are readable and writable as streams of elements then a transformation can be viewed as a flat-map operation on this stream, defined by lambdas.

      • Detail hiding — Many parts of a class file (constant pool, bootstrap method table, stack maps, etc.) are derived from other parts of the class file. It makes no sense to ask the user to construct these directly; this is extra work for the user and increases the chance of error. The library will automatically generate entities that are tightly coupled to other entities based on the methods, fields, and instructions added to the class file.

      • Lean into the language — In 2002, the visitor approach used by ASM seemed clever, and was surely more pleasant to use than what came before. However, the Java programming language has improved tremendously since then — with the introduction of lambdas, records, sealed classes, and pattern matching — and the platform now has a standard API for describing class-file constants (java.lang.constant). We can use these to design an API that is more flexible and pleasant to use, less verbose, and less error-prone.

      Specification

      The javadoc for the packages with the implementation as of November 20, 2023 is at https://cr.openjdk.org/~asotona/JDK-8308753-preview/api/java.base/java/lang/classfile/package-summary.html

      More details can be found in the JEP issue https://bugs.openjdk.org/browse/JDK-8280389

      The implementation of Class-file API exports the following packages, defined in module java.base.

      Package java.lang.classfile

      Interfaces

      AccessFlags
      Models the access flags for a class, method, or field.
      Annotation
      Models an annotation on a declaration.
      AnnotationElement
      Models a key-value pair of an annotation.
      AnnotationValue
      Models the value of a key-value pair of an annotation.
      AnnotationValue.OfAnnotation
      Models an annotation-valued element
      AnnotationValue.OfArray
      Models an array-valued element
      AnnotationValue.OfBoolean
      Models a constant-valued element
      AnnotationValue.OfByte
      Models a constant-valued element
      AnnotationValue.OfCharacter
      Models a constant-valued element
      AnnotationValue.OfClass
      Models a class-valued element
      AnnotationValue.OfConstant
      Models a constant-valued element
      AnnotationValue.OfDouble
      Models a constant-valued element
      AnnotationValue.OfEnum
      Models an enum-valued element
      AnnotationValue.OfFloat
      Models a constant-valued element
      AnnotationValue.OfInteger
      Models a constant-valued element
      AnnotationValue.OfLong
      Models a constant-valued element
      AnnotationValue.OfShort
      Models a constant-valued element
      AnnotationValue.OfString
      Models a constant-valued element
      Attribute<A extends Attribute<A>>
      Models a classfile attribute 4.7.
      AttributedElement
      A ClassFileElement describing an entity that has attributes, such as a class, field, method, code attribute, or record component.
      AttributeMapper<A>
      Bidirectional mapper between the classfile representation of an attribute and how that attribute is modeled in the API.
      BootstrapMethodEntry
      Models an entry in the bootstrap method table.
      BufWriter
      Supports writing portions of a classfile to a growable buffer.
      ClassBuilder
      A builder for classfiles.
      ClassElement
      A ClassFileElement that can appear when traversing the elements of a ClassModel or be presented to a ClassBuilder.
      ClassFile
      Represents a context for parsing, transforming, and generating classfiles.
      ClassFile.AttributeMapperOption
      Option describing attribute mappers for custom attributes.
      ClassFile.ClassHierarchyResolverOption
      Option describing the class hierarchy resolver to use when generating stack maps.
      ClassFile.Option
      An option that affects the writing of classfiles.
      ClassFileBuilder<E extends ClassFileElement,B extends ClassFileBuilder<E,B>>
      A builder for a classfile or portion of a classfile.
      ClassFileElement
      Immutable model for a portion of (or the entirety of) a classfile.
      ClassFileTransform<C extends ClassFileTransform<C,E,B>,E extends ClassFileElement,B extends ClassFileBuilder<E,B>>
      A transformation on streams of elements.
      ClassFileTransform.ResolvedTransform<E extends ClassFileElement>
      The result of binding a transform to a builder.
      ClassFileVersion
      Models the classfile version information for a class.
      ClassHierarchyResolver
      Provides class hierarchy information for generating correct stack maps during code building.
      ClassModel
      Models a classfile.
      ClassReader
      Supports reading from a classfile.
      ClassSignature
      Models the generic signature of a class file, as defined by 4.7.9.
      ClassTransform
      A transformation on streams of ClassElement.
      CodeBuilder
      A builder for code attributes (method bodies).
      CodeBuilder.BlockCodeBuilder
      A builder for blocks of code.
      CodeBuilder.CatchBuilder
      A builder to add catch blocks.
      CodeElement
      A ClassFileElement that can appear when traversing the elements of a CodeModel or be presented to a CodeBuilder.
      CodeModel
      Models the body of a method (the Code attribute).
      CodeTransform
      A transformation on streams of CodeElement.
      CompoundElement<E extends ClassFileElement>
      A ClassFileElement that has complex structure defined in terms of other classfile elements, such as a method, field, method body, or entire class.
      FieldBuilder
      A builder for fields.
      FieldElement
      A ClassFileElement that can appear when traversing the elements of a FieldModel or be presented to a FieldBuilder.
      FieldModel
      Models a field.
      FieldTransform
      A transformation on streams of FieldElement.
      Instruction
      Models an executable instruction in a method body.
      Interfaces
      Models the interfaces of a class.
      Label
      A marker for a position within the instructions of a method body.
      MethodBuilder
      A builder for methods.
      MethodElement
      A ClassFileElement that can appear when traversing the elements of a MethodModel or be presented to a MethodBuilder.
      MethodModel
      Models a method.
      MethodSignature
      Models the generic signature of a method, as defined by 4.7.9.
      MethodTransform
      A transformation on streams of MethodElement.
      PseudoInstruction
      Models metadata about a CodeAttribute, such as entries in the exception table, line number table, local variable table, or the mapping between instructions and labels.
      Signature
      Models generic Java type signatures, as defined in 4.7.9.1.
      Signature.ArrayTypeSig
      Models the signature of an array type.
      Signature.BaseTypeSig
      Models the signature of a primitive type or void
      Signature.ClassTypeSig
      Models the signature of a possibly-parameterized class or interface type.
      Signature.RefTypeSig
      Models the signature of a reference type, which may be a class, interface, type variable, or array type.
      Signature.ThrowableSig
      Models a signature for a throwable type.
      Signature.TypeArg
      Models the type argument.
      Signature.TypeParam
      Models a signature for a type parameter of a generic class or method.
      Signature.TypeVarSig
      Models the signature of a type variable.
      Superclass
      Models the superclass of a class.
      TypeAnnotation
      Models an annotation on a type use.
      TypeAnnotation.CatchTarget
      Indicates that an annotation appears on the i'th type in an exception parameter declaration.
      TypeAnnotation.EmptyTarget
      Indicates that an annotation appears on either the type in a field declaration, the return type of a method, the type of a newly constructed object, or the receiver type of a method or constructor.
      TypeAnnotation.FormalParameterTarget
      Indicates that an annotation appears on the type in a formal parameter declaration of a method, constructor, or lambda expression.
      TypeAnnotation.LocalVarTarget
      Indicates that an annotation appears on the type in a local variable declaration, including a variable declared as a resource in a try-with-resources statement.
      TypeAnnotation.LocalVarTargetInfo
      Indicates a range of code array offsets within which a local variable has a value, and the index into the local variable array of the current frame at which that local variable can be found.
      TypeAnnotation.OffsetTarget
      Indicates that an annotation appears on either the type in an instanceof expression or a new expression, or the type before the :: in a method reference expression.
      TypeAnnotation.SupertypeTarget
      Indicates that an annotation appears on a type in the extends or implements clause of a class or interface declaration.
      TypeAnnotation.TargetInfo
      Specifies which type in a declaration or expression is being annotated.
      TypeAnnotation.ThrowsTarget
      Indicates that an annotation appears on the i'th type in the throws clause of a method or constructor declaration.
      TypeAnnotation.TypeArgumentTarget
      Indicates that an annotation appears either on the i'th type in a cast expression, or on the i'th type argument in the explicit type argument list for any of the following: a new expression, an explicit constructor invocation statement, a method invocation expression, or a method reference expression.
      TypeAnnotation.TypeParameterBoundTarget
      Indicates that an annotation appears on the i'th bound of the j'th type parameter declaration of a generic class, interface, method, or constructor.
      TypeAnnotation.TypeParameterTarget
      Indicates that an annotation appears on the declaration of the i'th type parameter of a generic class, generic interface, generic method, or generic constructor.
      TypeAnnotation.TypePathComponent
      JVMS: Wherever a type is used in a declaration or expression, the type_path structure identifies which part of the type is annotated.
      WritableElement<T>
      A classfile element that can encode itself as a stream of bytes in the encoding expected by the classfile format.

      Classes

      Attributes
      Attribute mappers for standard classfile attributes.
      CustomAttribute<T extends CustomAttribute<T>>
      Models a non-standard attribute of a classfile.

      Enum Classes

      ClassFile.ConstantPoolSharingOption
      Option describing whether to preserve the original constant pool when transforming a classfile.
      ClassFile.DeadCodeOption
      Option describing whether or not to patch out unreachable code.
      ClassFile.DeadLabelsOption
      Option describing whether or not to filter unresolved labels.
      ClassFile.DebugElementsOption
      Option describing whether to process or discard debug elements.
      ClassFile.LineNumbersOption
      Option describing whether to process or discard line numbers.
      ClassFile.ShortJumpsOption
      Option describing whether or not to automatically rewrite short jumps to long when necessary.
      ClassFile.StackMapsOption
      Option describing whether or not to generate stackmaps.
      ClassFile.UnknownAttributesOption
      Option describing whether to process or discard unrecognized attributes.
      Opcode
      Describes the opcodes of the JVM instruction set, as well as a number of pseudo-instructions that may be encountered when traversing the instructions of a method.
      Opcode.Kind
      Kinds of opcodes.
      Signature.TypeArg.WildcardIndicator
      Indicator for whether a wildcard has default bound, no bound, an upper bound, or a lower bound
      TypeAnnotation.TargetType
      The kind of target on which the annotation appears.
      TypeAnnotation.TypePathComponent.Kind
       
      TypeKind
      Describes the types that can be part of a field or method descriptor.

      Record Class

      ClassHierarchyResolver.ClassHierarchyInfo
      Information about a resolved class.

      Package java.lang.classfile.attribute

      Interfaces

      AnnotationDefaultAttribute
      Models the AnnotationDefault attribute 4.7.22, which can appear on methods of annotation types, and records the default value 9.6.2 for the element corresponding to this method.
      BootstrapMethodsAttribute
      Models the BootstrapMethods attribute 4.7.23, which serves as an extension to the constant pool of a classfile.
      CharacterRangeInfo
      Models a single character range in the CharacterRangeTableAttribute.
      CharacterRangeTableAttribute
      The CharacterRangeTable attribute is an optional variable-length attribute in the attributes table of a Code attribute.
      CodeAttribute
      Models the Code attribute 4.7.3, appears on non-native, non-abstract methods and contains the bytecode of the method body.
      CompilationIDAttribute
      Models the CompilationID attribute (@@@ need reference), which can appear on classes and records the compilation time of the class.
      ConstantValueAttribute
      Models the ConstantValue attribute 4.7.2, which can appear on fields and indicates that the field's value is a constant.
      DeprecatedAttribute
      Models the Deprecated attribute 4.7.15, which can appear on classes, methods, and fields.
      EnclosingMethodAttribute
      Models the EnclosingMethod attribute 4.7.7, which can appear on classes, and indicates that the class is a local or anonymous class.
      ExceptionsAttribute
      Models the Exceptions attribute 4.7.5, which can appear on methods, and records the exceptions declared to be thrown by this method.
      InnerClassesAttribute
      Models the InnerClasses attribute 4.7.6, which can appear on classes, and records which classes referenced by this classfile are inner classes.
      InnerClassInfo
      Models a single inner class in the InnerClassesAttribute.
      LineNumberInfo
      Models a single line number in the LineNumberTableAttribute.
      LineNumberTableAttribute
      Models the LineNumberTable attribute 4.7.12, which can appear on a Code attribute, and records the mapping between indexes into the code table and line numbers in the source file.
      LocalVariableInfo
      Models a single local variable in the LocalVariableTableAttribute.
      LocalVariableTableAttribute
      Models the LocalVariableTable attribute 4.7.13, which can appear on a Code attribute, and records debug information about local variables.
      LocalVariableTypeInfo
      Models a single local variable in the LocalVariableTypeTableAttribute.
      LocalVariableTypeTableAttribute
      Models the LocalVariableTypeTable attribute 4.7.14, which can appear on a Code attribute, and records debug information about local variables.
      MethodParameterInfo
      Models a single method parameter in the MethodParametersAttribute.
      MethodParametersAttribute
      Models the MethodParameters attribute 4.7.24, which can appear on methods, and records optional information about the method's parameters.
      ModuleAttribute
      Models the Module attribute 4.7.25, which can appear on classes that represent module descriptors.
      ModuleAttribute.ModuleAttributeBuilder
       
      ModuleExportInfo
      Models a single "exports" declaration in the ModuleAttribute.
      ModuleHashesAttribute
      Models the ModuleHashes attribute, which can appear on classes that represent module descriptors.
      ModuleHashInfo
      Models hash information for a single module in the ModuleHashesAttribute.
      ModuleMainClassAttribute
      Models the ModuleMainClass attribute 4.7.27, which can appear on classes that represent module descriptors.
      ModuleOpenInfo
      Models a single "opens" declaration in the ModuleAttribute.
      ModulePackagesAttribute
      Models the ModulePackages attribute 4.7.26, which can appear on classes that represent module descriptors.
      ModuleProvideInfo
      Models a single "provides" declaration in the ModuleAttribute.
      ModuleRequireInfo
      Models a single "requires" declaration in the ModuleAttribute.
      ModuleResolutionAttribute
      Models the ModuleResolution attribute, which can appear on classes that represent module descriptors.
      ModuleTargetAttribute
      Models the ModuleTarget attribute, which can appear on classes that represent module descriptors.
      NestHostAttribute
      Models the NestHost attribute 4.7.28, which can appear on classes to indicate that this class is a member of a nest.
      NestMembersAttribute
      Models the NestMembers attribute 4.7.29, which can appear on classes to indicate that this class is the host of a nest.
      PermittedSubclassesAttribute
      Models the PermittedSubclasses attribute 4.7.31, which can appear on classes to indicate which classes may extend this class.
      RecordAttribute
      Models the Record attribute 4.7.30, which can appear on classes to indicate that this class is a record class.
      RecordComponentInfo
      Models a single record component in the RecordAttribute.
      RuntimeInvisibleAnnotationsAttribute
      Models the RuntimeInvisibleAnnotations attribute 4.7.17, which can appear on classes, methods, and fields.
      RuntimeInvisibleParameterAnnotationsAttribute
      Models the RuntimeInvisibleParameterAnnotations attribute 4.7.19, which can appear on methods.
      RuntimeInvisibleTypeAnnotationsAttribute
      Models the RuntimeInvisibleTypeAnnotations attribute 4.7.21, which can appear on classes, methods, fields, and code attributes.
      RuntimeVisibleAnnotationsAttribute
      Models the RuntimeVisibleAnnotations attribute 4.7.16, which can appear on classes, methods, and fields.
      RuntimeVisibleParameterAnnotationsAttribute
      Models the RuntimeVisibleParameterAnnotations attribute 4.7.18, which can appear on methods.
      RuntimeVisibleTypeAnnotationsAttribute
      Models the RuntimeVisibleTypeAnnotations attribute 4.7.20, which can appear on classes, methods, fields, and code attributes.
      SignatureAttribute
      Models the Signature attribute 4.7.9, which can appear on classes, methods, or fields.
      SourceDebugExtensionAttribute
      SourceDebugExtensionAttribute.
      SourceFileAttribute
      Models the SourceFile attribute 4.7.10, which can appear on classes.
      SourceIDAttribute
      Models the SourceFile attribute (@@@ reference needed), which can appear on classes.
      StackMapFrameInfo
      Models stack map frame of StackMapTable attribute 4.7.4.
      StackMapFrameInfo.ObjectVerificationTypeInfo
      A stack value for an object type.
      StackMapFrameInfo.UninitializedVerificationTypeInfo
      An uninitialized stack value.
      StackMapFrameInfo.VerificationTypeInfo
      The type of a stack value.
      StackMapTableAttribute
      Models the StackMapTable attribute 4.7.4, which can appear on a Code attribute.
      SyntheticAttribute
      Models the Synthetic attribute 4.7.8, which can appear on classes, methods, and fields.
      UnknownAttribute
      Models an unknown attribute on a class, method, or field.

      Enum Class

      StackMapFrameInfo.SimpleVerificationTypeInfo
      A simple stack value.

      Package java.lang.classfile.components

      Interfaces

      ClassPrinter.LeafNode
      A leaf node holding single printable value.
      ClassPrinter.ListNode
      A tree node holding List of nested nodes.
      ClassPrinter.MapNode
      A tree node holding Map of nested nodes.
      ClassPrinter.Node
      Named, traversable, and printable node parent.
      ClassRemapper
      ClassRemapper is a ClassTransform, FieldTransform, MethodTransform and CodeTransform deeply re-mapping all class references in any form, according to given map or map function.
      CodeLocalsShifter
      CodeLocalsShifter is a CodeTransform shifting locals to newly allocated positions to avoid conflicts during code injection.
      CodeRelabeler
      A code relabeler is a CodeTransform replacing all occurrences of Label in the transformed code with new instances.
      CodeStackTracker
      CodeStackTracker is a CodeTransform tracking stack content and calculating max stack size.

      Class

      ClassPrinter
      A printer of classfiles and its elements.

      Enum Class

      ClassPrinter.Verbosity
      Level of detail to print or export.

      Package java.lang.classfile.constantpool

      Interfaces

      AnnotationConstantValueEntry
      A constant pool entry that may be used as an annotation constant, which includes the four kinds of primitive constants, and UTF8 constants.
      ClassEntry
      Models a CONSTANT_Class_info constant in the constant pool of a classfile.
      ConstantDynamicEntry
      Models a CONSTANT_Dynamic_info constant in the constant pool of a classfile.
      ConstantPool
      Provides read access to the constant pool and bootstrap method table of a classfile.
      ConstantPoolBuilder
      Builder for the constant pool of a classfile.
      ConstantValueEntry
      Models a constant pool entry that can be used as the constant in a ConstantValue attribute; this includes the four primitive constant types and String constants.
      DoubleEntry
      Models a CONSTANT_Double_info constant in the constant pool of a classfile.
      DynamicConstantPoolEntry
      Models a dynamic constant pool entry, which is either ConstantDynamicEntry or InvokeDynamicEntry.
      FieldRefEntry
      Models a CONSTANT_Fieldref_info constant in the constant pool of a classfile.
      FloatEntry
      Models a CONSTANT_Float_info constant in the constant pool of a classfile.
      IntegerEntry
      Models a CONSTANT_Integer_info constant in the constant pool of a classfile.
      InterfaceMethodRefEntry
      Models a CONSTANT_InterfaceMethodRef_info constant in the constant pool of a classfile.
      InvokeDynamicEntry
      Models a constant pool entry for a dynamic call site.
      LoadableConstantEntry
      Marker interface for constant pool entries suitable for loading via the LDC instructions.
      LongEntry
      Models a CONSTANT_Long_info constant in the constant pool of a classfile.
      MemberRefEntry
      Models a member reference constant in the constant pool of a classfile, which includes references to fields, methods, and interface methods.
      MethodHandleEntry
      Models a CONSTANT_MethodHandle_info constant in the constant pool of a classfile.
      MethodRefEntry
      Models a CONSTANT_MethodRef_info constant in the constant pool of a classfile.
      MethodTypeEntry
      Models a CONSTANT_MethodType_info constant in the constant pool of a classfile.
      ModuleEntry
      Models a CONSTANT_Module_info constant in the constant pool of a classfile.
      NameAndTypeEntry
      Models a CONSTANT_NameAndType_info constant in the constant pool of a classfile.
      PackageEntry
      Models a CONSTANT_Package_info constant in the constant pool of a classfile.
      PoolEntry
      Models an entry in the constant pool of a classfile.
      StringEntry
      Models a CONSTANT_String_info constant in the constant pool of a classfile.
      Utf8Entry
      Models a CONSTANT_UTF8_info constant in the constant pool of a classfile.

      Package java.lang.classfile.instruction

      Interfaces

      ArrayLoadInstruction
      Models an array load instruction in the code array of a Code attribute.
      ArrayStoreInstruction
      Models an array store instruction in the code array of a Code attribute.
      BranchInstruction
      Models a branching instruction (conditional or unconditional) in the code array of a Code attribute.
      CharacterRange
      A pseudo-instruction which models a single entry in the CharacterRangeTableAttribute.
      ConstantInstruction
      Models a constant-load instruction in the code array of a Code attribute, including "intrinsic constant" instructions (e.g., iconst_0), "argument constant" instructions (e.g., bipush), and "load constant" instructions (e.g., LDC).
      ConstantInstruction.ArgumentConstantInstruction
      Models an "argument constant" instruction (e.g., bipush).
      ConstantInstruction.IntrinsicConstantInstruction
      Models an "intrinsic constant" instruction (e.g., iconst_0).
      ConstantInstruction.LoadConstantInstruction
      Models a "load constant" instruction (e.g., ldc).
      ConvertInstruction
      Models a primitive conversion instruction in the code array of a Code attribute, such as i2l.
      DiscontinuedInstruction
      Models instruction discontinued from the code array of a Code attribute.
      DiscontinuedInstruction.JsrInstruction
      Models JSR and JSR_W instructions discontinued from the code array of a Code attribute since class file version 51.0.
      DiscontinuedInstruction.RetInstruction
      Models RET and RET_W instructions discontinued from the code array of a Code attribute since class file version 51.0.
      ExceptionCatch
      A pseudo-instruction modeling an entry in the exception table of a code attribute.
      FieldInstruction
      Models a field access instruction in the code array of a Code attribute.
      IncrementInstruction
      Models a local variable increment instruction in the code array of a Code attribute.
      InvokeDynamicInstruction
      Models an invokedynamic instruction in the code array of a Code attribute.
      InvokeInstruction
      Models a method invocation instruction in the code array of a Code attribute, other than invokedynamic.
      LabelTarget
      A pseudo-instruction which indicates that the specified label corresponds to the current position in the Code attribute.
      LineNumber
      A pseudo-instruction which models a single entry in the LineNumberTableAttribute.
      LoadInstruction
      Models a local variable load instruction in the code array of a Code attribute.
      LocalVariable
      A pseudo-instruction which models a single entry in the LocalVariableTableAttribute.
      LocalVariableType
      A pseudo-instruction which models a single entry in the LocalVariableTypeTableAttribute.
      LookupSwitchInstruction
      Models a lookupswitch instruction in the code array of a Code attribute.
      MonitorInstruction
      Models a monitorenter or monitorexit instruction in the code array of a Code attribute.
      NewMultiArrayInstruction
      Models a multianewarray invocation instruction in the code array of a Code attribute.
      NewObjectInstruction
      Models a new instruction in the code array of a Code attribute.
      NewPrimitiveArrayInstruction
      Models a newarray invocation instruction in the code array of a Code attribute.
      NewReferenceArrayInstruction
      Models a anewarray invocation instruction in the code array of a Code attribute.
      NopInstruction
      Models a nop invocation instruction in the code array of a Code attribute.
      OperatorInstruction
      Models an arithmetic operator instruction in the code array of a Code attribute.
      ReturnInstruction
      Models a return-from-method instruction in the code array of a Code attribute.
      StackInstruction
      Models a stack manipulation instruction in the code array of a Code attribute.
      StoreInstruction
      Models a local variable store instruction in the code array of a Code attribute.
      SwitchCase
      Models a single case in a lookupswitch or tableswitch instruction.
      TableSwitchInstruction
      Models a tableswitch instruction in the code array of a Code attribute.
      ThrowInstruction
      Models an athrow instruction in the code array of a Code attribute.
      TypeCheckInstruction
      Models an instanceof or checkcast instruction in the code array of a Code attribute.

            asotona Adam Sotona
            asotona Adam Sotona
            Joe Darcy
            Votes:
            1 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated:
              Resolved: