Class AbstractNodeVisitor
java.lang.Object
org.springframework.shell.command.parser.AbstractNodeVisitor
- All Implemented Interfaces:
NodeVisitor
- Direct Known Subclasses:
Parser.DefaultNodeVisitor
Base abstract
NodeVisitor
which visits all nodes allowing user to
implement callback methods.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected abstract Parser.ParseResult
Called after all nodes has been visited to build results.protected abstract void
Called whenCommandArgumentNode
is entered.protected abstract void
Called whenCommandNode
is entered.protected abstract void
Called whenDirectiveNode
is entered.protected abstract void
Called whenOptionArgumentNode
is entered.protected abstract void
onEnterOptionNode
(OptionNode node) Called whenOptionNode
is entered.protected abstract void
Called whenCommandNode
for root is entered.protected abstract void
Called whenCommandArgumentNode
is exited.protected abstract void
onExitCommandNode
(CommandNode node) Called whenCommandNode
is exited.protected abstract void
Called whenDirectiveNode
is exited.protected abstract void
Called whenOptionArgumentNode
is exited.protected abstract void
onExitOptionNode
(OptionNode node) Called whenOptionNode
is exited.protected abstract void
Called whenCommandNode
for root is exited.final Parser.ParseResult
visit
(List<NonterminalAstNode> nonterminalNodes, List<TerminalAstNode> terminalNodes) Visit lists of non terminal and terminal nodes.
-
Constructor Details
-
AbstractNodeVisitor
public AbstractNodeVisitor()
-
-
Method Details
-
visit
public final Parser.ParseResult visit(List<NonterminalAstNode> nonterminalNodes, List<TerminalAstNode> terminalNodes) Description copied from interface:NodeVisitor
Visit lists of non terminal and terminal nodes.- Specified by:
visit
in interfaceNodeVisitor
- Parameters:
nonterminalNodes
- non terminal nodesterminalNodes
- terminal nodes- Returns:
- parser result
-
buildResult
Called after all nodes has been visited to build results.- Returns:
- the results from this visit operation
-
onEnterRootCommandNode
Called whenCommandNode
for root is entered. When node is fully visited,onExitRootCommandNode(CommandNode)
is called.- Parameters:
node
- the command node- See Also:
-
onExitRootCommandNode
Called whenCommandNode
for root is exited.- Parameters:
node
- the command node- See Also:
-
onEnterCommandNode
Called whenCommandNode
is entered. When node is fully visited,onExitCommandNode(CommandNode)
is called.- Parameters:
node
- the command node- See Also:
-
onExitCommandNode
Called whenCommandNode
is exited.- Parameters:
node
- the command node- See Also:
-
onEnterOptionNode
Called whenOptionNode
is entered. When node is fully visited,onExitOptionNode(OptionNode)
is called.- Parameters:
node
- the option node- See Also:
-
onExitOptionNode
Called whenOptionNode
is exited.- Parameters:
node
- the option node- See Also:
-
onEnterCommandArgumentNode
Called whenCommandArgumentNode
is entered. When node is fully visited,onExitCommandArgumentNode(CommandArgumentNode)
is called.- Parameters:
node
- the command argument node- See Also:
-
onExitCommandArgumentNode
Called whenCommandArgumentNode
is exited.- Parameters:
node
- the command argument node- See Also:
-
onEnterOptionArgumentNode
Called whenOptionArgumentNode
is entered. When node is fully visited,onExitOptionArgumentNode(OptionArgumentNode)
is called.- Parameters:
node
- the option argument node- See Also:
-
onExitOptionArgumentNode
Called whenOptionArgumentNode
is exited.- Parameters:
node
- the command argument node- See Also:
-
onEnterDirectiveNode
Called whenDirectiveNode
is entered. When node is fully visited,onExitDirectiveNode(DirectiveNode)
is called.- Parameters:
node
- the option node- See Also:
-
onExitDirectiveNode
Called whenDirectiveNode
is exited.- Parameters:
node
- the option node- See Also:
-