I am considering writing approaches
class MyClass {
@Get
@Set
protected int aValue;
}
and then automatically generate the get_aValue () and set_AValue () methods for the class.
I found these features:
1a) At compile time. Use the annotation handler to separately process MyClass.java, then write a new MyClass.java and finally use this last (replacing the original) with the rest of .java
1b) At compile time. Use the annotation handler to create the MyClassGenerated.java file with a new class (with get / set methods) that is this subclass of the original MyClass.
2) At runtime. Use java.lang.instrument and an external tool (e.g. BCEL) to weave the new code into MyClass.class.
, : , , , (, lombok BCEL)
a) - ?
b) ?
, 1a),
1b) ( MyClassGeneradted MyClass, , , )
2) ( , ).