Reflectify -- plug-in for reflective API access [message #259329] |
Sat, 04 April 2009 14:12  |
Eclipse User |
|
|
|
Originally posted by: jwloka.cs.rutgers.edu
Hi there,
using APIs via java.lang.relfect can be tedious and also quite painful.
Reflectify is a small plug-in that offers Quick Assists for
"reflectifying" class, instance, method and field accesses. The plug-in
provides the following transformations:
Reflectify Class Access, e.g.:
Foo.class --> Class.forName("p.Foo")
Reflectify Instance Access, e.g.:
new FooClass() --> Class.forName("p1.FooClass").newInstance()
Reflectify Method Access, e.g.:
v.getFoo() --> v.getClass().getMethod("getFoo").invoke(v)
Reflectify Field Access, e.g.:
v.bar --> v.getClass().getField("bar").get(v)
Reflectify Field Assignment, e.g.:
v.bar = new Object() --> v.getClass().getField("bar")
.set(v, new Object())
The plug-in is available at http://www.wlokas.de/jan/Reflectify.html
Give it a try,
Jan.
|
|
|
|
Powered by
FUDForum. Page generated in 0.03887 seconds