oracle.com/javase/tutorial/javabeans/index.html" target="_blank">JavaBeans property to access.
Note: To improve code readability, we recommend invoking the static method {@link org.fest.reflect.core.Reflection#property(String) Reflection.property(String)} instead of this class'constructor:
// import static {@link org.fest.reflect.core.Reflection#property(String) org.fest.reflect.core.Reflection.property}; // Equivalent to "String name = person.getName()" String name = {@link org.fest.reflect.core.Reflection#property(String) property}("name"). {@link org.fest.reflect.beanproperty.PropertyName#ofType(Class) ofType}(String.class). {@link org.fest.reflect.beanproperty.PropertyType#in(Object) in}(person). {@link org.fest.reflect.beanproperty.PropertyAccessor#get() get}(); // Equivalent to "person.setName("Yoda")" {@link org.fest.reflect.core.Reflection#property(String) property}("name"). {@link org.fest.reflect.beanproperty.PropertyName#ofType(Class) ofType}(String.class). {@link org.fest.reflect.beanproperty.PropertyType#in(Object) in}(person). {@link org.fest.reflect.beanproperty.PropertyAccessor#set(Object) set}("Yoda"); // Equivalent to "List<String> powers = jedi.getPowers()" List<String> powers = {@link org.fest.reflect.core.Reflection#property(String) property}("powers"). {@link org.fest.reflect.beanproperty.PropertyName#ofType(org.fest.reflect.reference.TypeRef) ofType}(new {@link org.fest.reflect.reference.TypeRef TypeRef}<List<String>>() {}). {@link org.fest.reflect.beanproperty.PropertyTypeRef#in(Object) in}(jedi). {@link org.fest.reflect.beanproperty.PropertyAccessor#get() get}(); // Equivalent to "jedi.setPowers(powers)" List<String> powers = new ArrayList<String>(); powers.add("heal"); {@link org.fest.reflect.core.Reflection#property(String) property}("powers"). {@link org.fest.reflect.beanproperty.PropertyName#ofType(org.fest.reflect.reference.TypeRef) ofType}(new {@link org.fest.reflect.reference.TypeRef TypeRef}<List<String>>() {}). {@link org.fest.reflect.beanproperty.PropertyTypeRef#in(Object) in}(jedi). {@link org.fest.reflect.beanproperty.PropertyAccessor#set(Object) set}(powers);
@author Alex Ruiz
@since 1.2