ClassFile.OptionClassFilepublic static sealed interface ClassFile.AttributeMapperOption extends ClassFile.Option
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.
| Modifier and Type | Method | Description |
|---|---|---|
Function |
attributeMapper() |
Returns the function mapping attribute names to attribute mappers. |
static ClassFile.AttributeMapperOption |
of |
Returns an option describing user-defined attributes for parsing. |
static ClassFile.AttributeMapperOption of(Function<Utf8Entry, AttributeMapper<?>> attributeMapper)
attributeMapper - a function mapping attribute names to attribute mappersFunction<Utf8Entry, AttributeMapper<?>> attributeMapper()
© 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