Package org.openrewrite.polyglot
Interface Polyglot
-
- All Superinterfaces:
Tree
- All Known Subinterfaces:
Polyglot.Member
- All Known Implementing Classes:
Polyglot.ArrayElement,Polyglot.ArrayElements,Polyglot.Error,Polyglot.Executable,Polyglot.HashEntries,Polyglot.HashEntry,Polyglot.Instance,Polyglot.Instantiable,Polyglot.Members,Polyglot.NumberValue,Polyglot.Source,Polyglot.StringValue
public interface Polyglot extends Tree
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classPolyglot.ArrayElementstatic classPolyglot.ArrayElementsstatic classPolyglot.Errorstatic classPolyglot.Executablestatic classPolyglot.HashEntriesstatic classPolyglot.HashEntrystatic classPolyglot.Instancestatic classPolyglot.Instantiablestatic interfacePolyglot.Memberstatic classPolyglot.Membersstatic classPolyglot.NumberValuestatic classPolyglot.Sourcestatic classPolyglot.StringValuestatic classPolyglot.ValueMarker
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default <R extends Tree,P>
Raccept(TreeVisitor<R,P> v, P p)Supports polymorphic visiting viaTreeVisitor.visit(Tree, Object).default <P> @Nullable PolyglotacceptPolyglot(PolyglotVisitor<P> pv, P p)default <T> java.util.Optional<T>as(java.lang.Class<T> targetType)org.graalvm.polyglot.ValuegetValue()default <P> booleanisAcceptable(TreeVisitor<?,P> v, P p)Checks the supplied argument to see if the supplied visitor and its context would be valid arguments to accept().-
Methods inherited from interface org.openrewrite.Tree
getId, getJacksonPolymorphicTypeTag, isScope, print, print, print, print, printer, printTrimmed, printTrimmed, printTrimmed
-
-
-
-
Method Detail
-
getValue
org.graalvm.polyglot.Value getValue()
-
as
default <T> java.util.Optional<T> as(java.lang.Class<T> targetType)
-
accept
@Nullable default <R extends Tree,P> R accept(TreeVisitor<R,P> v, P p)
Description copied from interface:TreeSupports polymorphic visiting viaTreeVisitor.visit(Tree, Object). This is useful in cases where an AST type contains a field that is of a type with a hierarchy. The visitor doesn't have to figure out which visit method to call by using instanceof.
-
acceptPolyglot
@Nullable default <P> @Nullable Polyglot acceptPolyglot(PolyglotVisitor<P> pv, P p)
-
isAcceptable
default <P> boolean isAcceptable(TreeVisitor<?,P> v, P p)
Description copied from interface:TreeChecks the supplied argument to see if the supplied visitor and its context would be valid arguments to accept(). Typically this involves checking that the visitor is of a type that operates on this kind of tree. e.g.: A Java Tree implementation would return true for JavaVisitors and false for MavenVisitors- Specified by:
isAcceptablein interfaceTree- Type Parameters:
P- the visitor's context argument- Returns:
- 'true' if the arguments to this function would be valid arguments to accept()
-
-