< prev index next >

src/java.base/share/classes/jdk/internal/classfile/Attribute.java

Print this page

 30 import jdk.internal.classfile.attribute.CodeAttribute;
 31 import jdk.internal.classfile.attribute.CompilationIDAttribute;
 32 import jdk.internal.classfile.attribute.ConstantValueAttribute;
 33 import jdk.internal.classfile.attribute.DeprecatedAttribute;
 34 import jdk.internal.classfile.attribute.EnclosingMethodAttribute;
 35 import jdk.internal.classfile.attribute.ExceptionsAttribute;
 36 import jdk.internal.classfile.attribute.InnerClassesAttribute;
 37 import jdk.internal.classfile.attribute.LineNumberTableAttribute;
 38 import jdk.internal.classfile.attribute.LocalVariableTableAttribute;
 39 import jdk.internal.classfile.attribute.LocalVariableTypeTableAttribute;
 40 import jdk.internal.classfile.attribute.MethodParametersAttribute;
 41 import jdk.internal.classfile.attribute.ModuleAttribute;
 42 import jdk.internal.classfile.attribute.ModuleHashesAttribute;
 43 import jdk.internal.classfile.attribute.ModuleMainClassAttribute;
 44 import jdk.internal.classfile.attribute.ModulePackagesAttribute;
 45 import jdk.internal.classfile.attribute.ModuleResolutionAttribute;
 46 import jdk.internal.classfile.attribute.ModuleTargetAttribute;
 47 import jdk.internal.classfile.attribute.NestHostAttribute;
 48 import jdk.internal.classfile.attribute.NestMembersAttribute;
 49 import jdk.internal.classfile.attribute.PermittedSubclassesAttribute;

 50 import jdk.internal.classfile.attribute.RecordAttribute;
 51 import jdk.internal.classfile.attribute.RuntimeInvisibleAnnotationsAttribute;
 52 import jdk.internal.classfile.attribute.RuntimeInvisibleParameterAnnotationsAttribute;
 53 import jdk.internal.classfile.attribute.RuntimeInvisibleTypeAnnotationsAttribute;
 54 import jdk.internal.classfile.attribute.RuntimeVisibleAnnotationsAttribute;
 55 import jdk.internal.classfile.attribute.RuntimeVisibleParameterAnnotationsAttribute;
 56 import jdk.internal.classfile.attribute.RuntimeVisibleTypeAnnotationsAttribute;
 57 import jdk.internal.classfile.attribute.SignatureAttribute;
 58 import jdk.internal.classfile.attribute.SourceDebugExtensionAttribute;
 59 import jdk.internal.classfile.attribute.SourceFileAttribute;
 60 import jdk.internal.classfile.attribute.SourceIDAttribute;
 61 import jdk.internal.classfile.attribute.StackMapTableAttribute;
 62 import jdk.internal.classfile.attribute.SyntheticAttribute;
 63 import jdk.internal.classfile.attribute.UnknownAttribute;
 64 import jdk.internal.classfile.impl.BoundAttribute;
 65 import jdk.internal.classfile.impl.UnboundAttribute;
 66 
 67 /**
 68  * Models a classfile attribute {@jvms 4.7}.  Many, though not all, subtypes of
 69  * {@linkplain Attribute} will implement {@link ClassElement}, {@link
 70  * MethodElement}, {@link FieldElement}, or {@link CodeElement}; attributes that
 71  * are also elements will be delivered when traversing the elements of the
 72  * corresponding model type. Additionally, all attributes are accessible
 73  * directly from the corresponding model type through {@link
 74  * AttributedElement#findAttribute(AttributeMapper)}.
 75  * @param <A> the attribute type
 76  */
 77 public sealed interface Attribute<A extends Attribute<A>>
 78         extends WritableElement<A>
 79         permits AnnotationDefaultAttribute, BootstrapMethodsAttribute,
 80                 CharacterRangeTableAttribute, CodeAttribute, CompilationIDAttribute,
 81                 ConstantValueAttribute, DeprecatedAttribute, EnclosingMethodAttribute,
 82                 ExceptionsAttribute, InnerClassesAttribute, LineNumberTableAttribute,
 83                 LocalVariableTableAttribute, LocalVariableTypeTableAttribute,
 84                 MethodParametersAttribute, ModuleAttribute, ModuleHashesAttribute,
 85                 ModuleMainClassAttribute, ModulePackagesAttribute, ModuleResolutionAttribute,
 86                 ModuleTargetAttribute, NestHostAttribute, NestMembersAttribute,
 87                 PermittedSubclassesAttribute,
 88                 RecordAttribute, RuntimeInvisibleAnnotationsAttribute,
 89                 RuntimeInvisibleParameterAnnotationsAttribute, RuntimeInvisibleTypeAnnotationsAttribute,
 90                 RuntimeVisibleAnnotationsAttribute, RuntimeVisibleParameterAnnotationsAttribute,
 91                 RuntimeVisibleTypeAnnotationsAttribute, SignatureAttribute,
 92                 SourceDebugExtensionAttribute, SourceFileAttribute, SourceIDAttribute,
 93                 StackMapTableAttribute, SyntheticAttribute,
 94                 UnknownAttribute, BoundAttribute, UnboundAttribute {
 95     /**
 96      * {@return the name of the attribute}
 97      */
 98     String attributeName();
 99 
100     /**
101      * {@return the {@link AttributeMapper} associated with this attribute}
102      */
103     AttributeMapper<A> attributeMapper();
104 }

 30 import jdk.internal.classfile.attribute.CodeAttribute;
 31 import jdk.internal.classfile.attribute.CompilationIDAttribute;
 32 import jdk.internal.classfile.attribute.ConstantValueAttribute;
 33 import jdk.internal.classfile.attribute.DeprecatedAttribute;
 34 import jdk.internal.classfile.attribute.EnclosingMethodAttribute;
 35 import jdk.internal.classfile.attribute.ExceptionsAttribute;
 36 import jdk.internal.classfile.attribute.InnerClassesAttribute;
 37 import jdk.internal.classfile.attribute.LineNumberTableAttribute;
 38 import jdk.internal.classfile.attribute.LocalVariableTableAttribute;
 39 import jdk.internal.classfile.attribute.LocalVariableTypeTableAttribute;
 40 import jdk.internal.classfile.attribute.MethodParametersAttribute;
 41 import jdk.internal.classfile.attribute.ModuleAttribute;
 42 import jdk.internal.classfile.attribute.ModuleHashesAttribute;
 43 import jdk.internal.classfile.attribute.ModuleMainClassAttribute;
 44 import jdk.internal.classfile.attribute.ModulePackagesAttribute;
 45 import jdk.internal.classfile.attribute.ModuleResolutionAttribute;
 46 import jdk.internal.classfile.attribute.ModuleTargetAttribute;
 47 import jdk.internal.classfile.attribute.NestHostAttribute;
 48 import jdk.internal.classfile.attribute.NestMembersAttribute;
 49 import jdk.internal.classfile.attribute.PermittedSubclassesAttribute;
 50 import jdk.internal.classfile.attribute.PreloadAttribute;
 51 import jdk.internal.classfile.attribute.RecordAttribute;
 52 import jdk.internal.classfile.attribute.RuntimeInvisibleAnnotationsAttribute;
 53 import jdk.internal.classfile.attribute.RuntimeInvisibleParameterAnnotationsAttribute;
 54 import jdk.internal.classfile.attribute.RuntimeInvisibleTypeAnnotationsAttribute;
 55 import jdk.internal.classfile.attribute.RuntimeVisibleAnnotationsAttribute;
 56 import jdk.internal.classfile.attribute.RuntimeVisibleParameterAnnotationsAttribute;
 57 import jdk.internal.classfile.attribute.RuntimeVisibleTypeAnnotationsAttribute;
 58 import jdk.internal.classfile.attribute.SignatureAttribute;
 59 import jdk.internal.classfile.attribute.SourceDebugExtensionAttribute;
 60 import jdk.internal.classfile.attribute.SourceFileAttribute;
 61 import jdk.internal.classfile.attribute.SourceIDAttribute;
 62 import jdk.internal.classfile.attribute.StackMapTableAttribute;
 63 import jdk.internal.classfile.attribute.SyntheticAttribute;
 64 import jdk.internal.classfile.attribute.UnknownAttribute;
 65 import jdk.internal.classfile.impl.BoundAttribute;
 66 import jdk.internal.classfile.impl.UnboundAttribute;
 67 
 68 /**
 69  * Models a classfile attribute {@jvms 4.7}.  Many, though not all, subtypes of
 70  * {@linkplain Attribute} will implement {@link ClassElement}, {@link
 71  * MethodElement}, {@link FieldElement}, or {@link CodeElement}; attributes that
 72  * are also elements will be delivered when traversing the elements of the
 73  * corresponding model type. Additionally, all attributes are accessible
 74  * directly from the corresponding model type through {@link
 75  * AttributedElement#findAttribute(AttributeMapper)}.
 76  * @param <A> the attribute type
 77  */
 78 public sealed interface Attribute<A extends Attribute<A>>
 79         extends WritableElement<A>
 80         permits AnnotationDefaultAttribute, BootstrapMethodsAttribute,
 81                 CharacterRangeTableAttribute, CodeAttribute, CompilationIDAttribute,
 82                 ConstantValueAttribute, DeprecatedAttribute, EnclosingMethodAttribute,
 83                 ExceptionsAttribute, InnerClassesAttribute, LineNumberTableAttribute,
 84                 LocalVariableTableAttribute, LocalVariableTypeTableAttribute,
 85                 MethodParametersAttribute, ModuleAttribute, ModuleHashesAttribute,
 86                 ModuleMainClassAttribute, ModulePackagesAttribute, ModuleResolutionAttribute,
 87                 ModuleTargetAttribute, NestHostAttribute, NestMembersAttribute,
 88                 PermittedSubclassesAttribute, PreloadAttribute,
 89                 RecordAttribute, RuntimeInvisibleAnnotationsAttribute,
 90                 RuntimeInvisibleParameterAnnotationsAttribute, RuntimeInvisibleTypeAnnotationsAttribute,
 91                 RuntimeVisibleAnnotationsAttribute, RuntimeVisibleParameterAnnotationsAttribute,
 92                 RuntimeVisibleTypeAnnotationsAttribute, SignatureAttribute,
 93                 SourceDebugExtensionAttribute, SourceFileAttribute, SourceIDAttribute,
 94                 StackMapTableAttribute, SyntheticAttribute,
 95                 UnknownAttribute, BoundAttribute, UnboundAttribute {
 96     /**
 97      * {@return the name of the attribute}
 98      */
 99     String attributeName();
100 
101     /**
102      * {@return the {@link AttributeMapper} associated with this attribute}
103      */
104     AttributeMapper<A> attributeMapper();
105 }
< prev index next >