Spec-Zone.ru › 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:
  • AttributeMapper
  • CustomAttribute

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

Report a bug or suggest an enhancement
For further API reference and developer documentation see the Java SE Documentation, which contains more detailed, developer-targeted descriptions with conceptual overviews, definitions of terms, workarounds, and working code examples. Other versions.
Java is a trademark or registered trademark of Oracle and/or its affiliates in the US and other countries.
Copyright © 1993, 2025, Oracle and/or its affiliates, 500 Oracle Parkway, Redwood Shores, CA 94065 USA.
All rights reserved. Use is subject to license terms and the documentation redistribution policy.

© 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

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API