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 |
documentation() |
Returns a Supplier for the javadoc documentation for this Element.. |
Element |
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
keyword
String keyword()
Returns a possible continuation keyword, or
null if this item does not represent a keyword..- Returns:
- a possible continuation keyword, or
nullif this item does not represent a keyword.
matchesType
anchor
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.
© 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.