Visit-node takes a list of visitor functions, each with a signature (fn [node state]) that returns a context map, which can contain the keys: node, : state, : stop, or: jump.
visit - node获取一个访问者函数列表,其中每个函数都有一个返回上下文映射的签名(fn [nodestate]),上下文映射中可能包含键:node、: state、:stop或:jump。
PROCESS_ABORT — The visitor isn't interested in visiting at all, so accept returns false.
PROCESS_ABORT——访问程序对访问根本不感兴趣,所以accept返回false。
It returns one of the FileVisitResult's enum values to tell the file visitor API what to do next.
它返回一个filevisitresult枚举值,来告诉文件访问程序api下一步做什么。
This function returns an anonymous visitor function that will jump to the next node if the node is not of the correct type.
此函数返回一个匿名访问者函数,如果节点的类型不正确,则该函数将跳转到下一个节点。
If the visitor is interested, the node calls the visitor's visit method, which returns one of three values.
如果感兴趣,该节点调用访问程序的visit方法,该方法返回下列三个值中的一个。
PROCESS_SKIP — the visitor isn't interested in the node's children, so accept returns true.
PROCESS_SKIP——访问程序对该节点的子节点不感兴趣,所以accept返回true。
The string-visitor function looks for a string node and returns an updated state that captures the node.
string-visitor函数查找字符串节点,并返回捕捉该节点的更新后状态。
The primary difference in tree-visitor is that the visit-node function returns several items: a new-node, a new-state, and a stop flag.
tree-visitor中的主要差别在于,visit-node函数返回多个项目:一个 new-node、一个new-state和一个 stop 标记。
If the Boolean field is false or visit returns PROCESS_CONTINUE, accept calls the accept method of each of its children and passes the visitor as its argument.
如果Boolean字段为false或visit返回PROCESS_CONTINUE,accept调用每个子节点的accept方法并将访问程序当作其参数。
The string-finder calls the tree-visitor with string-visitor and returns the final state.
string - finder调用tree - visitor与string -visitor,并返回最终状态。
The string-finder calls the tree-visitor with string-visitor and returns the final state.
string - finder调用tree - visitor与string -visitor,并返回最终状态。
应用推荐