Module java.base
Package java.lang.classfile

# Interface ClassFileElement

≠
public abstract sealed interface ClassFileElement
permits java.lang.classfile.Attribute<A>, java.lang.classfile.AttributedElement, java.lang.classfile.ClassElement, java.lang.classfile.CodeElement, java.lang.classfile.CompoundElement<E>, java.lang.classfile.FieldElement, java.lang.classfile.MethodElement
Comparing master and cf

All Known Subinterfaces:
  `AccessFlags, AnnotationDefaultAttribute, ArrayLoadInstruction, ArrayStoreInstruction, Attribute<A>, AttributedElement, BootstrapMethodsAttribute, BranchInstruction, CharacterRange, CharacterRangeTableAttribute, ClassElement, ClassFileVersion, ClassModel, CodeAttribute, CodeElement, CodeModel, CompilationIDAttribute, CompoundElement<E>, ConstantInstruction, ConstantInstruction.ArgumentConstantInstruction, ConstantInstruction.IntrinsicConstantInstruction, ConstantInstruction.LoadConstantInstruction, ConstantValueAttribute, ConvertInstruction, DeprecatedAttribute, DiscontinuedInstruction, DiscontinuedInstruction.JsrInstruction, DiscontinuedInstruction.RetInstruction, EnclosingMethodAttribute, ExceptionCatch, ExceptionsAttribute, FieldElement, FieldInstruction, FieldModel, IncrementInstruction, InnerClassesAttribute, Instruction, Interfaces, InvokeDynamicInstruction, InvokeInstruction, LabelTarget, LineNumber, LineNumberTableAttribute, LoadInstruction, LocalVariable, LocalVariableTableAttribute, LocalVariableType, LocalVariableTypeTableAttribute, LookupSwitchInstruction, MethodElement, MethodModel, MethodParametersAttribute, ModuleAttribute, ModuleHashesAttribute, ModuleMainClassAttribute, ModulePackagesAttribute, ModuleResolutionAttribute, ModuleTargetAttribute, MonitorInstruction, NestHostAttribute, NestMembersAttribute, NewMultiArrayInstruction, NewObjectInstruction, NewPrimitiveArrayInstruction, NewReferenceArrayInstruction, NopInstruction, OperatorInstruction, PermittedSubclassesAttribute, PseudoInstruction, RecordAttribute, RecordComponentInfo, ReturnInstruction, RuntimeInvisibleAnnotationsAttribute, RuntimeInvisibleParameterAnnotationsAttribute, RuntimeInvisibleTypeAnnotationsAttribute, RuntimeVisibleAnnotationsAttribute, RuntimeVisibleParameterAnnotationsAttribute, RuntimeVisibleTypeAnnotationsAttribute, SignatureAttribute, SourceDebugExtensionAttribute, SourceFileAttribute, SourceIDAttribute, StackInstruction, StackMapTableAttribute, StoreInstruction, Superclass, SyntheticAttribute, TableSwitchInstruction, ThrowInstruction, TypeCheckInstruction, UnknownAttribute`

All Known Implementing Classes:
  `CustomAttribute`

public sealed interface ClassFileElement permits AttributedElement, CompoundElement<E>, Attribute<A>, ClassElement, CodeElement, FieldElement, MethodElement
Marker interface for structures with special capabilities in the `class` file format. `AttributedElement` indicates a structure has `Attribute` s. `CompoundElement` indicates a structure can be viewed as a composition of member structures, whose memberships are marked by `ClassElement` , `MethodElement` , `FieldElement` , or `CodeElement` .

## Membership Elements

`ClassModel` , `MethodModel` , `FieldModel` , and `CodeModel` each has a dedicated interface marking its member structures: `ClassElement` , `MethodElement` , `FieldElement` , and `CodeElement` . They can be supplied to a `ClassBuilder` , a `MethodBuilder` , a `FieldBuilder` , or a `CodeBuilder` to be included as members of the built model. Unless otherwise specified, these structures are delivered during the traversal of the corresponding models. Some of these elements may appear at most once or exactly once in the traversal of the models; such elements have special treatment by `ClassFileBuilder` and are specified in their modeling interfaces. If such elements appear multiple times during traversal, the last occurrence should be used and all previous instances should be discarded.

These membership element marker interfaces are sealed; future versions of the Java SE Platform may define new elements to the sealed hierarchy when the `class` file format for the Java Platform evolves. Using an exhaustive pattern matching switch over these hierarchies indicates the user only wish the processing code to run on a specific version of Java Platform, and will fail if unknown new elements are encountered

Immutable model for a portion of (or the entirety of) a classfile. Elements that model parts of the classfile that have attributes will implement `AttributedElement` ; elements that model complex parts of the classfile that themselves contain their own child elements will implement `CompoundElement` . Elements specific to various locations in the classfile will implement `ClassElement` , `MethodElement` , etc

Moved to a paragraph..

Sealed Class Hierarchy Graph:
Since:
  24

## Summary

Differences
| Elements | Comments | Descriptions | Total
Added | Changed | Removed | Added | Changed | Removed | Added | Changed | Removed
--- | --- | --- | --- | --- | --- | --- | --- | ---
ClassFileElement |  |  |  |  |  |  | 24 |  | 5 | 29
Total |  |  |  |  |  |  | 24 |  | 5 | 29