private static class CombinedCompilerPass.CallbackWrapper
extends java.lang.Object
NodeTraversal
. In particular, this
class simulates abbreviating the traversal when the wrapped callback
returns false for
NodeTraversal.Callback.shouldTraverse(NodeTraversal, Node, Node)
.
The callback becomes inactive (i.e., traversal messages are not sent to it)
until the main traversal revisits the node during the post-order visit.Modifier and Type | Field and Description |
---|---|
private NodeTraversal.Callback |
callback
The callback being wrapped.
|
private NodeTraversal.ScopedCallback |
scopedCallback
if (callback instanceof ScopedCallback), then scopedCallback points
to an instance of ScopedCallback, otherwise scopedCallback points to null
|
private Node |
waiting
The node that
NodeTraversal.Callback.shouldTraverse(NodeTraversal, Node, Node)
returned false for. |
Modifier | Constructor and Description |
---|---|
private |
CallbackWrapper(NodeTraversal.Callback callback) |
Modifier and Type | Method and Description |
---|---|
(package private) void |
enterScopeIfActive(NodeTraversal t) |
(package private) void |
exitScopeIfActive(NodeTraversal t) |
(package private) boolean |
isActive() |
(package private) void |
shouldTraverseIfActive(NodeTraversal t,
Node n,
Node parent) |
(package private) void |
visitOrMaybeActivate(NodeTraversal t,
Node n,
Node parent)
Visits the node unless the wrapped callback is inactive.
|
private final NodeTraversal.Callback callback
private final NodeTraversal.ScopedCallback scopedCallback
private Node waiting
NodeTraversal.Callback.shouldTraverse(NodeTraversal, Node, Node)
returned false for. The wrapped callback doesn't receive messages until
after this node is revisited in the post-order traversal.private CallbackWrapper(NodeTraversal.Callback callback)
void visitOrMaybeActivate(NodeTraversal t, Node n, Node parent)
void shouldTraverseIfActive(NodeTraversal t, Node n, Node parent)
void enterScopeIfActive(NodeTraversal t)
void exitScopeIfActive(NodeTraversal t)
boolean isActive()