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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract Parser.ParseResultCalled after all nodes has been visited to build results.protected abstract voidCalled whenCommandArgumentNodeis entered.protected abstract voidCalled whenCommandNodeis entered.protected abstract voidCalled whenDirectiveNodeis entered.protected abstract voidCalled whenOptionArgumentNodeis entered.protected abstract voidonEnterOptionNode(OptionNode node) Called whenOptionNodeis entered.protected abstract voidCalled whenCommandNodefor root is entered.protected abstract voidCalled whenCommandArgumentNodeis exited.protected abstract voidonExitCommandNode(CommandNode node) Called whenCommandNodeis exited.protected abstract voidCalled whenDirectiveNodeis exited.protected abstract voidCalled whenOptionArgumentNodeis exited.protected abstract voidonExitOptionNode(OptionNode node) Called whenOptionNodeis exited.protected abstract voidCalled whenCommandNodefor root is exited.final Parser.ParseResultvisit(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:NodeVisitorVisit lists of non terminal and terminal nodes.- Specified by:
visitin 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 whenCommandNodefor root is entered. When node is fully visited,onExitRootCommandNode(CommandNode)is called.- Parameters:
node- the command node- See Also:
-
onExitRootCommandNode
Called whenCommandNodefor root is exited.- Parameters:
node- the command node- See Also:
-
onEnterCommandNode
Called whenCommandNodeis entered. When node is fully visited,onExitCommandNode(CommandNode)is called.- Parameters:
node- the command node- See Also:
-
onExitCommandNode
Called whenCommandNodeis exited.- Parameters:
node- the command node- See Also:
-
onEnterOptionNode
Called whenOptionNodeis entered. When node is fully visited,onExitOptionNode(OptionNode)is called.- Parameters:
node- the option node- See Also:
-
onExitOptionNode
Called whenOptionNodeis exited.- Parameters:
node- the option node- See Also:
-
onEnterCommandArgumentNode
Called whenCommandArgumentNodeis entered. When node is fully visited,onExitCommandArgumentNode(CommandArgumentNode)is called.- Parameters:
node- the command argument node- See Also:
-
onExitCommandArgumentNode
Called whenCommandArgumentNodeis exited.- Parameters:
node- the command argument node- See Also:
-
onEnterOptionArgumentNode
Called whenOptionArgumentNodeis entered. When node is fully visited,onExitOptionArgumentNode(OptionArgumentNode)is called.- Parameters:
node- the option argument node- See Also:
-
onExitOptionArgumentNode
Called whenOptionArgumentNodeis exited.- Parameters:
node- the command argument node- See Also:
-
onEnterDirectiveNode
Called whenDirectiveNodeis entered. When node is fully visited,onExitDirectiveNode(DirectiveNode)is called.- Parameters:
node- the option node- See Also:
-
onExitDirectiveNode
Called whenDirectiveNodeis exited.- Parameters:
node- the option node- See Also:
-