W3cubDocs

/OpenJDK 25

Interface ClassFile.AttributeMapperOption

All Superinterfaces:
ClassFile.Option
Enclosing interface:
ClassFile
public static sealed interface ClassFile.AttributeMapperOption extends ClassFile.Option
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:

Method Summary

Modifier and Type Method Description
Function<Utf8Entry, AttributeMapper<?>> attributeMapper()
Returns the function mapping attribute names to attribute mappers.
static ClassFile.AttributeMapperOption of(Function<Utf8Entry, AttributeMapper<?>> attributeMapper)
Returns an option describing user-defined attributes for parsing.

Method Details

of

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

attributeMapper

Function<Utf8Entry, AttributeMapper<?>> attributeMapper()
Returns the function mapping attribute names to attribute mappers.
Returns:
the function mapping attribute names to attribute mappers

© 1993, 2025, Oracle and/or its affiliates. All rights reserved.
Documentation extracted from Debian's OpenJDK Development Kit package.
Licensed under the GNU General Public License, version 2, with the Classpath Exception.
Various third party code in OpenJDK is licensed under different licenses (see Debian package).
Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/classfile/ClassFile.AttributeMapperOption.html