Class CodeVisitor

java.lang.Object
io.github.mmm.code.api.object.CodeVisitor
Direct Known Subclasses:
CodeImportGeneratorVisitor

public abstract class CodeVisitor extends Object
Generic visitor to traverse the code AST (abstract syntax tree). Allows to recursively visit CodeElements, CodeNodes, and other related code elements. To visit simply create your own sub-class and call according visit method (e.g. visitFile(CodeFile) on it. You implementation may be stateful and collect data in fields of your implementation. To avoid performance issues some recursive traversals are not enabled by default. You may therefore override methods like isVisitDocs(), isVisitProperties(), isVisitComments() to activate deeper and more greedy recursion. Also you may override other methods like isVisitFields(), etc. if recursion is not needed in your case.
Since:
1.0.0