Module java.base
Package java.lang.classfile

# Interface ClassFile.AttributeMapperOption

≠
public abstract static sealed interface AttributeMapperOption
extends java.lang.classfile.ClassFile.Option
permits jdk.internal.classfile.impl.ClassFileImpl.AttributeMapperOptionImpl
Comparing master and cf

All Superinterfaces:
  `ClassFile.Option`

Enclosing interface:
  `ClassFile`

public static sealed interface ClassFile.AttributeMapperOption extends ClassFile.Option
Option describing attribute mappers for custom attributes. Default is only to process standard attributes.

Since:
  24

The option describing user-defined attributes for parsing `class` files. The default does not recognize any user-defined attribute.

An `AttributeMapperOption` contains a function that maps an attribute name to a user attribute mapper. The function may return `null` if it does not recognize an attribute name. The returned mapper must ensure its `name()` is equivalent to the `stringValue()` of the input `Utf8Entry` .

The mapping function in this attribute has lower priority than mappers in `Attributes` , so it is impossible to override built-in attributes with this option. If an attribute is not recognized by any mapper in `Attributes` and is not assigned a mapper, or recognized, by this option, that attribute will be modeled by an `UnknownAttribute` .

Since:
  24
See Also:
  - `AttributeMapper`
  - `CustomAttribute`

## Methods

- =
  public abstract java.util.function.Function<java.lang.classfile.constantpool.Utf8Entry, java.lang.classfile.AttributeMapper<?>> attributeMapper()
- ≠
  public static java.lang.classfile.ClassFile.AttributeMapperOption of(java.util.function.Function<java.lang.classfile.constantpool.Utf8Entry, java.lang.classfile.AttributeMapper<?>> arg0)
  Comparing master and cf

  ### of

  static ClassFile.AttributeMapperOption of (Function<Utf8Entry, AttributeMapper<?>> attributeMapper)
  Returns an option describing attribute mappers for custom attributesuser-defined attributes for parsing.
  Parameters:
    `attributeMapper` - a function mapping attribute names to attribute mappers
  Returns:
    an option describing attribute mappers for custom attributesuser-defined attributes for parsing

## Summary

Differences
| Elements | Comments | Descriptions | Total
Added | Changed | Removed | Added | Changed | Removed | Added | Changed | Removed
--- | --- | --- | --- | --- | --- | --- | --- | ---
ClassFile.AttributeMapperOption |  |  |  |  |  |  | 3 |  | 3 | 6
of(Function) |  |  |  |  |  |  | 2 | 2 |  | 4
Total |  |  |  |  |  |  | 5 | 2 | 3 | 10