https://github.com/zhuinden/funky-apt
[tiny demo thing] A super-duper-simple annotation processor which is executed to be debugged. And it generates a "Builder" class.
https://github.com/zhuinden/funky-apt
Last synced: 3 months ago
JSON representation
[tiny demo thing] A super-duper-simple annotation processor which is executed to be debugged. And it generates a "Builder" class.
- Host: GitHub
- URL: https://github.com/zhuinden/funky-apt
- Owner: Zhuinden
- Created: 2017-04-10T12:46:43.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2020-10-13T22:10:00.000Z (over 4 years ago)
- Last Synced: 2025-02-07T08:49:08.609Z (4 months ago)
- Language: Java
- Homepage:
- Size: 14.6 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# funky-apt
[tiny demo thing] A super-duper-simple annotation processor which is executed to be debugged. And it generates a Builder thing for non-private instance variables.```
c:\Development\HomeProjects\funky-apt\src\main\java\com\zhuinden\App.java:10: Note: Element traversed: com.zhuinden.App
public class App {
^
Note: Package Name [com.zhuinden], Class Name [com.zhuinden.App], Simple Name [App]
```So I have this:
``` java
@Funk
public class App {
String hello;
String world;...
```And generates this:
``` java
public final class AppBuilder {
private String hello;private String world;
public AppBuilder setHello(String hello) {
this.hello = hello;
return this;
}public AppBuilder setWorld(String world) {
this.world = world;
return this;
}public App build() {
App app = new App();
app.hello = this.hello;
app.world = this.world;
return app;
}
}
```