Spec-Zone.ru › OpenJDK 27

Interface CharacterRangeTableAttribute

All Superinterfaces:
Attribute<CharacterRangeTableAttribute>, ClassFileElement
public sealed interface CharacterRangeTableAttribute extends Attribute<CharacterRangeTableAttribute>
Models the CharacterRangeTable attribute, which is a bidirectional mapping from ranges of positions in the source file to ranges of indices into the code array. Its entries are delivered as CharacterRanges when traversing the elements of a CodeModel, toggled by ClassFile.DebugElementsOption.

The CharacterRangeTable attribute consists of an array of character range entries. The character range entries form a forest data structure: any two range entries are either disjoint, or if they overlap, then one entry must be enclosed within the other, both in code array indices and source file character positions. The character range entries may appear in any order.

This attribute only appears on Code attributes, permits multiple appearances but should only appear once in a Code attribute. It has a data dependency on labels.

This attribute cannot be sent to a CodeBuilder; its entries can be constructed with CharacterRange, resulting in at most one attribute instance in the built Code attribute.

This attribute is not predefined in the Java SE Platform. This is a JDK-specific nonstandard attribute produced by the reference implementation of the system Java compiler, defined by the jdk.compiler module.

Since:
24
See Also:
  • Attributes.characterRangeTable()
  • CompilationIDAttribute
  • SourceIDAttribute

Method Summary

Modifier and Type Method Description
List<CharacterRangeInfo> characterRangeTable()
Returns the entries of the character range table.
static CharacterRangeTableAttribute of(List<CharacterRangeInfo> ranges)
Returns a CharacterRangeTable attribute.

Methods declared in interface Attribute

attributeMapper, attributeName
Modifier and Type Method Description
AttributeMapper<CharacterRangeTableAttribute> attributeMapper()
Returns the AttributeMapper associated with this attribute.
Utf8Entry attributeName()
Returns the name of the attribute.

Method Details

characterRangeTable

List<CharacterRangeInfo> characterRangeTable()
Returns the entries of the character range table.
Returns:
the entries of the character range table

of

static CharacterRangeTableAttribute of(List<CharacterRangeInfo> ranges)
Returns a CharacterRangeTable attribute.
API Note:
The created attribute cannot be written to a CodeBuilder. Use CodeBuilder::characterRange instead.
Parameters:
ranges - the descriptions of the character ranges
Returns:
a CharacterRangeTable attribute
Throws:
IllegalArgumentException - if the number of ranges exceeds the limit of u2

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, 2026, 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.

Spec-Zone.ru

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