This project contains set of visitors from the docs of Rewrite project. The main purpose of this project is to show how java definitions can be used in the code. Also this project is real life example of what you can see in the docs of Rewrite project.
├── src
│ └── main
│ └── java
│ └── org
│ └── openrewrite
│ ├── after
│ ├── before
│ ├── definitions
│ ├── examplellib
│ ├── refactor
│ └── visitors
-
Folder
definitions
contains Java Definitions (visitors). -
Folder
visitor
contains additional visitors. -
Folder
refactor
containsRefactorProcessor
that works in the following way:// Example List<RefactorVisitor<?>> visitors = new ArrayList<>(){{ add(visitor1); add(visitor2); add(visitor3); }}; RefactorProcessor.run(visitors, "A.java");
RefactorProcessor.run(visitors, "A.java")
takes fileA.java
from folderbefore
, applies visitors which is inArrayList
(as first argument) and then puts updatedA.java
intoafter
folder. -
Folder
before
contains original java files. -
Folder
after
contains java files that have been processed by visitors fromdefinitions
folder.
Each of classes in definitions
folder is executable, which applies visitors for one specified java file from before
folder and puts updated version of it into after
folder.