Spec-Zone.ru › OpenJDK 27

Interface SourceCodeAnalysis.ElementSuggestion

Enclosing class:
SourceCodeAnalysis
public static sealed interface SourceCodeAnalysis.ElementSuggestion
A description of an Element that is a possible continuation of a given snippet.
API Note:
Instances of this interface and instances of the returned Elements should only be used and held during the execution of the SourceCodeAnalysis.completionSuggestions(java.lang.String, int, jdk.jshell.SourceCodeAnalysis.ElementSuggestionConvertor) method. Their use outside of the context of the method is not supported and the effect is undefined.
Since:
26

Method Summary

Modifier and Type Method Description
int anchor()
Returns the offset in the original snippet at which point this Element should be inserted..
Supplier<String> documentation()
Returns a Supplier for the javadoc documentation for this Element..
Element element()
Returns a possible continuation Element, or null if this item does not represent an Element..
String keyword()
Returns a possible continuation keyword, or null if this item does not represent a keyword..
boolean matchesType()
Returns true if this Element's type fits into the context..

Method Details

element

Element element()
Returns a possible continuation Element, or null if this item does not represent an Element..
Returns:
a possible continuation Element, or null if this item does not represent an Element.

keyword

String keyword()
Returns a possible continuation keyword, or null if this item does not represent a keyword..
Returns:
a possible continuation keyword, or null if this item does not represent a keyword.

matchesType

boolean matchesType()
Returns true if this Element's type fits into the context.. Typically used when the type of the element fits the expected type.
Returns:
true if this Element's type fits into the context.

anchor

int anchor()
Returns the offset in the original snippet at which point this Element should be inserted..
Returns:
the offset in the original snippet at which point this Element should be inserted.

documentation

Supplier<String> documentation()
Returns a Supplier for the javadoc documentation for this Element..
API Note:
The instance returned from this method is safe to hold for extended periods of time, and can be called outside of the context of the SourceCodeAnalysis.completionSuggestions(java.lang.String, int, jdk.jshell.SourceCodeAnalysis.ElementSuggestionConvertor) method.
Returns:
a Supplier for the javadoc documentation for this Element.

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