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 TypeMethodDescriptionintanchor()Returns the offset in the original snippet at which point this Element should be inserted..Returns a Supplier for the javadoc documentation for this Element..element()keyword()Returns a possible continuation keyword, ornullif this item does not represent a keyword..booleanReturnstrueif this Element's type fits into the context..
-
Method Details
-
element
-
keyword
String keyword()Returns a possible continuation keyword, ornullif this item does not represent a keyword..- Returns:
- a possible continuation keyword, or
nullif this item does not represent a keyword.
-
matchesType
-
anchor
-
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.
-