# Class Attributes

java.lang.Object
java.lang.classfile.Attributes

public final class Attributes extends Object
Attribute mappers for predefined (JVMS 4.7) and JDK-specific nonstandard attributes.

Unless otherwise specified, each mapper returned by methods in this class:

- is predefined in the JVMS instead of JDK-specific;
- does not permit multiple attribute instances in the same structure;
- the attribute has a data dependency on the constant pool.

Since:
  24
See Also:
  - `AttributeMapper`
  - `java.lang.classfile.attribute`

## Field Summary

Fields
Modifier and Type
Field
Description
`static final String`
`NAME_ANNOTATION_DEFAULT`
AnnotationDefault
`static final String`
`NAME_BOOTSTRAP_METHODS`
BootstrapMethods
`static final String`
`NAME_CHARACTER_RANGE_TABLE`
CharacterRangeTable
`static final String`
`NAME_CODE`
Code
`static final String`
`NAME_COMPILATION_ID`
CompilationID
`static final String`
`NAME_CONSTANT_VALUE`
ConstantValue
`static final String`
`NAME_DEPRECATED`
Deprecated
`static final String`
`NAME_ENCLOSING_METHOD`
EnclosingMethod
`static final String`
`NAME_EXCEPTIONS`
Exceptions
`static final String`
`NAME_INNER_CLASSES`
InnerClasses
`static final String`
`NAME_LINE_NUMBER_TABLE`
LineNumberTable
`static final String`
`NAME_LOCAL_VARIABLE_TABLE`
LocalVariableTable
`static final String`
`NAME_LOCAL_VARIABLE_TYPE_TABLE`
LocalVariableTypeTable
`static final String`
`NAME_METHOD_PARAMETERS`
MethodParameters
`static final String`
`NAME_MODULE`
Module
`static final String`
`NAME_MODULE_HASHES`
ModuleHashes
`static final String`
`NAME_MODULE_MAIN_CLASS`
ModuleMainClass
`static final String`
`NAME_MODULE_PACKAGES`
ModulePackages
`static final String`
`NAME_MODULE_RESOLUTION`
ModuleResolution
`static final String`
`NAME_MODULE_TARGET`
ModuleTarget
`static final String`
`NAME_NEST_HOST`
NestHost
`static final String`
`NAME_NEST_MEMBERS`
NestMembers
`static final String`
`NAME_PERMITTED_SUBCLASSES`
PermittedSubclasses
`static final String`
`NAME_RECORD`
Record
`static final String`
`NAME_RUNTIME_INVISIBLE_ANNOTATIONS`
RuntimeInvisibleAnnotations
`static final String`
`NAME_RUNTIME_INVISIBLE_PARAMETER_ANNOTATIONS`
RuntimeInvisibleParameterAnnotations
`static final String`
`NAME_RUNTIME_INVISIBLE_TYPE_ANNOTATIONS`
RuntimeInvisibleTypeAnnotations
`static final String`
`NAME_RUNTIME_VISIBLE_ANNOTATIONS`
RuntimeVisibleAnnotations
`static final String`
`NAME_RUNTIME_VISIBLE_PARAMETER_ANNOTATIONS`
RuntimeVisibleParameterAnnotations
`static final String`
`NAME_RUNTIME_VISIBLE_TYPE_ANNOTATIONS`
RuntimeVisibleTypeAnnotations
`static final String`
`NAME_SIGNATURE`
Signature
`static final String`
`NAME_SOURCE_DEBUG_EXTENSION`
SourceDebugExtension
`static final String`
`NAME_SOURCE_FILE`
SourceFile
`static final String`
`NAME_SOURCE_ID`
SourceID
`static final String`
`NAME_STACK_MAP_TABLE`
StackMapTable
`static final String`
`NAME_SYNTHETIC`
Synthetic

## Method Summary

Modifier and Type
Method
Description
`static AttributeMapper<AnnotationDefaultAttribute>`
`annotationDefault()`
Returns the mapper for the `AnnotationDefault` attribute.
`static AttributeMapper<BootstrapMethodsAttribute>`
`bootstrapMethods()`
Returns the mapper for the `BootstrapMethods` attribute.
`static AttributeMapper<CharacterRangeTableAttribute>`
`characterRangeTable()`
Returns the mapper for the `CharacterRangeTable` attribute.
`static AttributeMapper<CodeAttribute>`
`code()`
Returns the mapper for the `Code` attribute.
`static AttributeMapper<CompilationIDAttribute>`
`compilationId()`
Returns the mapper for the `CompilationID` attribute.
`static AttributeMapper<ConstantValueAttribute>`
`constantValue()`
Returns the mapper for the `ConstantValue` attribute.
`static AttributeMapper<DeprecatedAttribute>`
`deprecated()`
Returns the mapper for the `Deprecated` attribute.
`static AttributeMapper<EnclosingMethodAttribute>`
`enclosingMethod()`
Returns the mapper for the `EnclosingMethod` attribute.
`static AttributeMapper<ExceptionsAttribute>`
`exceptions()`
Returns the mapper for the `Exceptions` attribute.
`static AttributeMapper<InnerClassesAttribute>`
`innerClasses()`
Returns the mapper for the `InnerClasses` attribute.
`static AttributeMapper<LineNumberTableAttribute>`
`lineNumberTable()`
Returns the mapper for the `LineNumberTable` attribute.
`static AttributeMapper<LocalVariableTableAttribute>`
`localVariableTable()`
Returns the mapper for the `LocalVariableTable` attribute.
`static AttributeMapper<LocalVariableTypeTableAttribute>`
`localVariableTypeTable()`
Returns the mapper for the `LocalVariableTypeTable` attribute.
`static AttributeMapper<MethodParametersAttribute>`
`methodParameters()`
Returns the mapper for the `MethodParameters` attribute.
`static AttributeMapper<ModuleAttribute>`
`module()`
Returns the mapper for the `Module` attribute.
`static AttributeMapper<ModuleHashesAttribute>`
`moduleHashes()`
Returns the mapper for the `ModuleHashes` attribute.
`static AttributeMapper<ModuleMainClassAttribute>`
`moduleMainClass()`
Returns the mapper for the `ModuleMainClass` attribute.
`static AttributeMapper<ModulePackagesAttribute>`
`modulePackages()`
Returns the mapper for the `ModulePackages` attribute.
`static AttributeMapper<ModuleResolutionAttribute>`
`moduleResolution()`
Returns the mapper for the `ModuleResolution` attribute.
`static AttributeMapper<ModuleTargetAttribute>`
`moduleTarget()`
Returns the mapper for the `ModuleTarget` attribute.
`static AttributeMapper<NestHostAttribute>`
`nestHost()`
Returns the mapper for the `NestHost` attribute.
`static AttributeMapper<NestMembersAttribute>`
`nestMembers()`
Returns the mapper for the `NestMembers` attribute.
`static AttributeMapper<PermittedSubclassesAttribute>`
`permittedSubclasses()`
Returns the mapper for the `PermittedSubclasses` attribute.
`static AttributeMapper<RecordAttribute>`
`record()`
Returns the mapper for the `Record` attribute.
`static AttributeMapper<RuntimeInvisibleAnnotationsAttribute>`
`runtimeInvisibleAnnotations()`
Returns the mapper for the `RuntimeInvisibleAnnotations` attribute.
`static AttributeMapper<RuntimeInvisibleParameterAnnotationsAttribute>`
`runtimeInvisibleParameterAnnotations()`
Returns the mapper for the `RuntimeInvisibleParameterAnnotations` attribute.
`static AttributeMapper<RuntimeInvisibleTypeAnnotationsAttribute>`
`runtimeInvisibleTypeAnnotations()`
Returns the mapper for the `RuntimeInvisibleTypeAnnotations` attribute.
`static AttributeMapper<RuntimeVisibleAnnotationsAttribute>`
`runtimeVisibleAnnotations()`
Returns the mapper for the `RuntimeVisibleAnnotations` attribute.
`static AttributeMapper<RuntimeVisibleParameterAnnotationsAttribute>`
`runtimeVisibleParameterAnnotations()`
Returns the mapper for the `RuntimeVisibleParameterAnnotations` attribute.
`static AttributeMapper<RuntimeVisibleTypeAnnotationsAttribute>`
`runtimeVisibleTypeAnnotations()`
Returns the mapper for the `RuntimeVisibleTypeAnnotations` attribute.
`static AttributeMapper<SignatureAttribute>`
`signature()`
Returns the mapper for the `Signature` attribute.
`static AttributeMapper<SourceDebugExtensionAttribute>`
`sourceDebugExtension()`
Returns the mapper for the `SourceDebugExtension` attribute.
`static AttributeMapper<SourceFileAttribute>`
`sourceFile()`
Returns the mapper for the `SourceFile` attribute.
`static AttributeMapper<SourceIDAttribute>`
`sourceId()`
Returns the mapper for the `SourceID` attribute.
`static AttributeMapper<StackMapTableAttribute>`
`stackMapTable()`
Returns the mapper for the `StackMapTable` attribute.
`static AttributeMapper<SyntheticAttribute>`
`synthetic()`
Returns the mapper for the `Synthetic` attribute.

### Methods declared in class Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Field Details

### NAME_ANNOTATION_DEFAULT

public static final String NAME_ANNOTATION_DEFAULT
AnnotationDefault

See Also:
  - Constant Field Values

### NAME_BOOTSTRAP_METHODS

public static final String NAME_BOOTSTRAP_METHODS
BootstrapMethods

See Also:
  - Constant Field Values

### NAME_CHARACTER_RANGE_TABLE

public static final String NAME_CHARACTER_RANGE_TABLE
CharacterRangeTable

See Also:
  - Constant Field Values

### NAME_CODE

public static final String NAME_CODE
Code

See Also:
  - Constant Field Values

### NAME_COMPILATION_ID

public static final String NAME_COMPILATION_ID
CompilationID

See Also:
  - Constant Field Values

### NAME_CONSTANT_VALUE

public static final String NAME_CONSTANT_VALUE
ConstantValue

See Also:
  - Constant Field Values

### NAME_DEPRECATED

public static final String NAME_DEPRECATED
Deprecated

See Also:
  - Constant Field Values

### NAME_ENCLOSING_METHOD

public static final String NAME_ENCLOSING_METHOD
EnclosingMethod

See Also:
  - Constant Field Values

### NAME_EXCEPTIONS

public static final String NAME_EXCEPTIONS
Exceptions

See Also:
  - Constant Field Values

### NAME_INNER_CLASSES

public static final String NAME_INNER_CLASSES
InnerClasses

See Also:
  - Constant Field Values

### NAME_LINE_NUMBER_TABLE

public static final String NAME_LINE_NUMBER_TABLE
LineNumberTable

See Also:
  - Constant Field Values

### NAME_LOCAL_VARIABLE_TABLE

public static final String NAME_LOCAL_VARIABLE_TABLE
LocalVariableTable

See Also:
  - Constant Field Values

### NAME_LOCAL_VARIABLE_TYPE_TABLE

public static final String NAME_LOCAL_VARIABLE_TYPE_TABLE
LocalVariableTypeTable

See Also:
  - Constant Field Values

### NAME_METHOD_PARAMETERS

public static final String NAME_METHOD_PARAMETERS
MethodParameters

See Also:
  - Constant Field Values

### NAME_MODULE

public static final String NAME_MODULE
Module

See Also:
  - Constant Field Values

### NAME_MODULE_HASHES

public static final String NAME_MODULE_HASHES
ModuleHashes

See Also:
  - Constant Field Values

### NAME_MODULE_MAIN_CLASS

public static final String NAME_MODULE_MAIN_CLASS
ModuleMainClass

See Also:
  - Constant Field Values

### NAME_MODULE_PACKAGES

public static final String NAME_MODULE_PACKAGES
ModulePackages

See Also:
  - Constant Field Values

### NAME_MODULE_RESOLUTION

public static final String NAME_MODULE_RESOLUTION
ModuleResolution

See Also:
  - Constant Field Values

### NAME_MODULE_TARGET

public static final String NAME_MODULE_TARGET
ModuleTarget

See Also:
  - Constant Field Values

### NAME_NEST_HOST

public static final String NAME_NEST_HOST
NestHost

See Also:
  - Constant Field Values

### NAME_NEST_MEMBERS

public static final String NAME_NEST_MEMBERS
NestMembers

See Also:
  - Constant Field Values

### NAME_PERMITTED_SUBCLASSES

public static final String NAME_PERMITTED_SUBCLASSES
PermittedSubclasses

See Also:
  - Constant Field Values

### NAME_RECORD

public static final String NAME_RECORD
Record

See Also:
  - Constant Field Values

### NAME_RUNTIME_INVISIBLE_ANNOTATIONS

public static final String NAME_RUNTIME_INVISIBLE_ANNOTATIONS
RuntimeInvisibleAnnotations

See Also:
  - Constant Field Values

### NAME_RUNTIME_INVISIBLE_PARAMETER_ANNOTATIONS

public static final String NAME_RUNTIME_INVISIBLE_PARAMETER_ANNOTATIONS
RuntimeInvisibleParameterAnnotations

See Also:
  - Constant Field Values

### NAME_RUNTIME_INVISIBLE_TYPE_ANNOTATIONS

public static final String NAME_RUNTIME_INVISIBLE_TYPE_ANNOTATIONS
RuntimeInvisibleTypeAnnotations

See Also:
  - Constant Field Values

### NAME_RUNTIME_VISIBLE_ANNOTATIONS

public static final String NAME_RUNTIME_VISIBLE_ANNOTATIONS
RuntimeVisibleAnnotations

See Also:
  - Constant Field Values

### NAME_RUNTIME_VISIBLE_PARAMETER_ANNOTATIONS

public static final String NAME_RUNTIME_VISIBLE_PARAMETER_ANNOTATIONS
RuntimeVisibleParameterAnnotations

See Also:
  - Constant Field Values

### NAME_RUNTIME_VISIBLE_TYPE_ANNOTATIONS

public static final String NAME_RUNTIME_VISIBLE_TYPE_ANNOTATIONS
RuntimeVisibleTypeAnnotations

See Also:
  - Constant Field Values

### NAME_SIGNATURE

public static final String NAME_SIGNATURE
Signature

See Also:
  - Constant Field Values

### NAME_SOURCE_DEBUG_EXTENSION

public static final String NAME_SOURCE_DEBUG_EXTENSION
SourceDebugExtension

See Also:
  - Constant Field Values

### NAME_SOURCE_FILE

public static final String NAME_SOURCE_FILE
SourceFile

See Also:
  - Constant Field Values

### NAME_SOURCE_ID

public static final String NAME_SOURCE_ID
SourceID

See Also:
  - Constant Field Values

### NAME_STACK_MAP_TABLE

public static final String NAME_STACK_MAP_TABLE
StackMapTable

See Also:
  - Constant Field Values

### NAME_SYNTHETIC

public static final String NAME_SYNTHETIC
Synthetic

See Also:
  - Constant Field Values

## Method Details

### annotationDefault

public static AttributeMapper<AnnotationDefaultAttribute> annotationDefault()
Returns the mapper for the `AnnotationDefault` attribute.

Returns:
  the mapper for the `AnnotationDefault` attribute

### bootstrapMethods

public static AttributeMapper<BootstrapMethodsAttribute> bootstrapMethods()
Returns the mapper for the `BootstrapMethods` attribute.

Returns:
  the mapper for the `BootstrapMethods` attribute

### characterRangeTable

public static AttributeMapper<CharacterRangeTableAttribute> characterRangeTable()
Returns the mapper for the `CharacterRangeTable` attribute. This is a JDK-specific attribute. The mapper permits multiple instances in a `Code` attribute, but this attribute should be only emitted once. This has a data dependency on labels.

Returns:
  the mapper for the `CharacterRangeTable` attribute

### code

public static AttributeMapper<CodeAttribute> code()
Returns the mapper for the `Code` attribute.

Returns:
  the mapper for the `Code` attribute

### compilationId

public static AttributeMapper<CompilationIDAttribute> compilationId()
Returns the mapper for the `CompilationID` attribute. This is a JDK-specific attribute.

Returns:
  the mapper for the `CompilationID` attribute

### constantValue

public static AttributeMapper<ConstantValueAttribute> constantValue()
Returns the mapper for the `ConstantValue` attribute.

Returns:
  the mapper for the `ConstantValue` attribute

### deprecated

public static AttributeMapper<DeprecatedAttribute> deprecated()
Returns the mapper for the `Deprecated` attribute. The mapper permits multiple instances in a given location. This has no data dependency.

Returns:
  the mapper for the `Deprecated` attribute

### enclosingMethod

public static AttributeMapper<EnclosingMethodAttribute> enclosingMethod()
Returns the mapper for the `EnclosingMethod` attribute.

Returns:
  the mapper for the `EnclosingMethod` attribute

### exceptions

public static AttributeMapper<ExceptionsAttribute> exceptions()
Returns the mapper for the `Exceptions` attribute.

Returns:
  the mapper for the `Exceptions` attribute

### innerClasses

public static AttributeMapper<InnerClassesAttribute> innerClasses()
Returns the mapper for the `InnerClasses` attribute.

Returns:
  the mapper for the `InnerClasses` attribute

### lineNumberTable

public static AttributeMapper<LineNumberTableAttribute> lineNumberTable()
Returns the mapper for the `LineNumberTable` attribute. The mapper permits multiple instances in a `Code` attribute. This has a data dependency on labels.

Returns:
  the mapper for the `LineNumberTable` attribute

### localVariableTable

public static AttributeMapper<LocalVariableTableAttribute> localVariableTable()
Returns the mapper for the `LocalVariableTable` attribute. The mapper permits multiple instances in a `Code` attribute. This has a data dependency on labels.

Returns:
  the mapper for the `LocalVariableTable` attribute

### localVariableTypeTable

public static AttributeMapper<LocalVariableTypeTableAttribute> localVariableTypeTable()
Returns the mapper for the `LocalVariableTypeTable` attribute. The mapper permits multiple instances in a given location. This has a data dependency on labels.

Returns:
  the mapper for the `LocalVariableTypeTable` attribute

### methodParameters

public static AttributeMapper<MethodParametersAttribute> methodParameters()
Returns the mapper for the `MethodParameters` attribute.

Returns:
  the mapper for the `MethodParameters` attribute

### module

public static AttributeMapper<ModuleAttribute> module()
Returns the mapper for the `Module` attribute.

Returns:
  the mapper for the `Module` attribute

### moduleHashes

public static AttributeMapper<ModuleHashesAttribute> moduleHashes()
Returns the mapper for the `ModuleHashes` attribute. This is a JDK-specific attribute.

Returns:
  the mapper for the `ModuleHashes` attribute

### moduleMainClass

public static AttributeMapper<ModuleMainClassAttribute> moduleMainClass()
Returns the mapper for the `ModuleMainClass` attribute.

Returns:
  the mapper for the `ModuleMainClass` attribute

### modulePackages

public static AttributeMapper<ModulePackagesAttribute> modulePackages()
Returns the mapper for the `ModulePackages` attribute.

Returns:
  the mapper for the `ModulePackages` attribute

### moduleResolution

public static AttributeMapper<ModuleResolutionAttribute> moduleResolution()
Returns the mapper for the `ModuleResolution` attribute. This is a JDK-specific attribute. This has no data dependency.

Returns:
  the mapper for the `ModuleResolution` attribute

### moduleTarget

public static AttributeMapper<ModuleTargetAttribute> moduleTarget()
Returns the mapper for the `ModuleTarget` attribute. This is a JDK-specific attribute.

Returns:
  the mapper for the `ModuleTarget` attribute

### nestHost

public static AttributeMapper<NestHostAttribute> nestHost()
Returns the mapper for the `NestHost` attribute.

Returns:
  the mapper for the `NestHost` attribute

### nestMembers

public static AttributeMapper<NestMembersAttribute> nestMembers()
Returns the mapper for the `NestMembers` attribute.

Returns:
  the mapper for the `NestMembers` attribute

### permittedSubclasses

public static AttributeMapper<PermittedSubclassesAttribute> permittedSubclasses()
Returns the mapper for the `PermittedSubclasses` attribute.

Returns:
  the mapper for the `PermittedSubclasses` attribute

### record

public static AttributeMapper<RecordAttribute> record()
Returns the mapper for the `Record` attribute.

Returns:
  the mapper for the `Record` attribute

### runtimeInvisibleAnnotations

public static AttributeMapper<RuntimeInvisibleAnnotationsAttribute> runtimeInvisibleAnnotations()
Returns the mapper for the `RuntimeInvisibleAnnotations` attribute.

Returns:
  the mapper for the `RuntimeInvisibleAnnotations` attribute

### runtimeInvisibleParameterAnnotations

public static AttributeMapper<RuntimeInvisibleParameterAnnotationsAttribute> runtimeInvisibleParameterAnnotations()
Returns the mapper for the `RuntimeInvisibleParameterAnnotations` attribute.

Returns:
  the mapper for the `RuntimeInvisibleParameterAnnotations` attribute

### runtimeInvisibleTypeAnnotations

public static AttributeMapper<RuntimeInvisibleTypeAnnotationsAttribute> runtimeInvisibleTypeAnnotations()
Returns the mapper for the `RuntimeInvisibleTypeAnnotations` attribute. This has a data dependency on arbitrary indices in the `class` file format.

Returns:
  the mapper for the `RuntimeInvisibleTypeAnnotations` attribute

### runtimeVisibleAnnotations

public static AttributeMapper<RuntimeVisibleAnnotationsAttribute> runtimeVisibleAnnotations()
Returns the mapper for the `RuntimeVisibleAnnotations` attribute.

Returns:
  the mapper for the `RuntimeVisibleAnnotations` attribute

### runtimeVisibleParameterAnnotations

public static AttributeMapper<RuntimeVisibleParameterAnnotationsAttribute> runtimeVisibleParameterAnnotations()
Returns the mapper for the `RuntimeVisibleParameterAnnotations` attribute.

Returns:
  the mapper for the `RuntimeVisibleParameterAnnotations` attribute

### runtimeVisibleTypeAnnotations

public static AttributeMapper<RuntimeVisibleTypeAnnotationsAttribute> runtimeVisibleTypeAnnotations()
Returns the mapper for the `RuntimeVisibleTypeAnnotations` attribute. This has a data dependency on arbitrary indices in the `class` file format.

Returns:
  the mapper for the `RuntimeVisibleTypeAnnotations` attribute

### signature

public static AttributeMapper<SignatureAttribute> signature()
Returns the mapper for the `Signature` attribute.

Returns:
  the mapper for the `Signature` attribute

### sourceDebugExtension

public static AttributeMapper<SourceDebugExtensionAttribute> sourceDebugExtension()
Returns the mapper for the `SourceDebugExtension` attribute. This has no data dependency.

Returns:
  the mapper for the `SourceDebugExtension` attribute

### sourceFile

public static AttributeMapper<SourceFileAttribute> sourceFile()
Returns the mapper for the `SourceFile` attribute.

Returns:
  the mapper for the `SourceFile` attribute

### sourceId

public static AttributeMapper<SourceIDAttribute> sourceId()
Returns the mapper for the `SourceID` attribute. This is a JDK-specific attribute.

Returns:
  the mapper for the `SourceID` attribute

### stackMapTable

public static AttributeMapper<StackMapTableAttribute> stackMapTable()
Returns the mapper for the `StackMapTable` attribute. This has a data dependency on labels.

Returns:
  the mapper for the `StackMapTable` attribute

### synthetic

public static AttributeMapper<SyntheticAttribute> synthetic()
Returns the mapper for the `Synthetic` attribute. The mapper permits multiple instances in a given location. This has no data dependency.

Returns:
  the mapper for the `Synthetic` attribute