[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openjdk-compiler-dev
Subject:    Symbolic annotation processor
From:       bsrbnd <bsrbnd () gmail ! com>
Date:       2015-12-10 13:50:06
Message-ID: CAEgw74BztdzFb7ZcgHs4rvWtD8aqKdn_TSGuZjFtidyaUyHAYw () mail ! gmail ! com
[Download RAW message or body]

Hi,

Following our discussion (October 2015), I wrote an
annotation-processor (only a draft for now) that gives a symbolic view
of class members, for example:
@Symbolic private Object myField;
@Symbolic("_") private void myMethod(Object param) {}

We can either access the name or the reflective object of members the
following way:
String name = $myField.toString(); // $ is the default prefix
Method m = _myMethod.reflect(); // _ is a custom prefix, useful for
overloaded identifiers

You can find a simple example here:
https://github.com/bsrbnd/draft/blob/master/src/examples/Example.java

Full source code of the annotation-processor prototype is given there:
https://github.com/bsrbnd/draft

Comments are welcome, but I know this is probably not the right
mailing-list for that.

Regards,

Bernard
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic