poetix

this time for sure

Jacques - Java Deconstructor

A library for taking Java objects to bits.

For some example usages, see here

Jacques enables you to use a Key (a pointer to a field of some class, or a node in some data structure) to create an Accessor which can then be passed around and used to get or set the value referenced by that Key. Accessors can be bound to instances to create Properties, or to values to create Assigners:

Accessor<Person, String> NAME = accessor(Person.class, "name");
Person me = new Person("Dominic");

assertThat(NAME.get(me), is("Dominic"));

Property<String> myName = property(NAME).of(me);
assertThat(myName.get(), is("Dominic");

Assigner<Person> nameOfArthur = NAME.of("Arthur");
nameOfArthur.assignTo(me);
assertThat(myName.get(), is("Arthur");