Interface Polyglot

    • 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: Tree
        Supports polymorphic visiting via TreeVisitor.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.
        Specified by:
        accept in interface Tree
        Type Parameters:
        R - visitor return type
        P - visit context type
        Parameters:
        v - visitor
        p - visit context
        Returns:
        visitor result
      • isAcceptable

        default <P> boolean isAcceptable​(TreeVisitor<?,​P> v,
                                         P p)
        Description copied from interface: Tree
        Checks 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:
        isAcceptable in interface Tree
        Type Parameters:
        P - the visitor's context argument
        Returns:
        'true' if the arguments to this function would be valid arguments to accept()