jOOR - Fluent Reflection in Java jOOR is a very simple fluent API that gives access to your Java Class structures in a more intuitive way. The JDK's reflection APIs are hard and verbose to use. Other languages have much simpler constructs to access type meta information at runtime. Let us make Java reflection better.
The examples are using the on method but this method is deprecated and should be replaced by onClass.
Old:
String world = on("java.lang.String") // Like Class.forName()
.create("Hello World") // Call most specific matching constructor
.call("substring", 6) // Call most specific matching substring() method
.call("toString") // Call toString()
.get(); // Get the wrapped object, in this case a String
New:
String world = onClass("java.lang.String") // Like Class.forName()
.create("Hello World") // Call most specific matching constructor
.call("substring", 6) // Call most specific matching substring() method
.call("toString") // Call toString()
.get(); // Get the wrapped object, in this case a String
The examples are using the on method but this method is deprecated and should be replaced by onClass.
Old:
New: