We are proud to announce that FEST-Reflect 1.2 is out!
FEST-Reflect is a Java library that provides a fluent interface that simplifies the usage of Java Reflection and JavaBeans Introspection, resulting in improved readability and type safety. It supports class loading, access to static inner classes constructors, methods and fields, and more!
Example:
Person person = constructor().withParameterTypes(String.class) .in(Person.class) .newInstance("Yoda"); method("setName").withParameterTypes(String.class) .in(person) .invoke("Luke"); field("name").ofType(String.class) .in(person) .set("Anakin"); List<String> powers = field("powers").ofType(new TypeRef<List<String>>() {}) .in(jedi) .get();
Release notes
Bug
- [FEST-68] – FEST-Reflect is catching my
RuntimeExceptionwhile it should not! (issue 310.) Thanks to Francis.ANDRE. - [FEST-257] – FEST-Reflect should throw exception if static inner class is not found.
Improvement
- [FEST-256] – Replace constructor calls with fail-fast static factory methods.
New Feature
- [FEST-235] – Add API to reflect bean properties. Thanks to Jean-Francois Poilpret.
Example:// equivalent to calling "getName()" String name = property("name").ofType(String.class) .in(person) .get();
FEST-Swing can be downloaded here (file fest-reflect-1.2.zip.) FEST requires Java SE 5.0 or later.
Links
Feedback is always appreciated :)
My name is Alex Ruiz. I'm a programmer with special interest in Java, API design, testing and OOP. I'm the creator of 


#1 by Karam on November 30, 2009 - 4:36 pm
The project looks interesting.
In you example, “Add API to reflect bean properties”, the comment says you are setting a property however the code is for getting a property.
#2 by Alex Ruiz on November 30, 2009 - 5:10 pm
Thanks Karam! It is fixed now :)