r01f.reflection.fluent
Class PropertyTypes.PropertyTypeGenerics<T>

java.lang.Object
  extended by r01f.reflection.fluent.PropertyTypes.PropertyTypeGenerics<T>
Type Parameters:
T - the generic type of the property.
Enclosing class:
PropertyTypes

public static class PropertyTypes.PropertyTypeGenerics<T>
extends java.lang.Object

Understands the type of a property to access using Bean Instrospection. This implementation supports Java generics.

The following is an example of proper usage of this class:

   // Retrieves the value of the property "powers"
   List powers = Reflection.property("powers").ofType(new TypeRef>() {}).in(jedi).get();
 
   // Sets the value of the property "powers"
   List powers = new ArrayList();
   powers.add("heal");
   Reflection.property("powers").ofType(new TypeRef>() {}).in(jedi).set(powers);
 


Field Summary
private  java.lang.String _propertyName
           
private  TypeRef<T> _propertyType
           
 
Constructor Summary
PropertyTypes.PropertyTypeGenerics(java.lang.String name, TypeRef<T> type)
           
 
Method Summary
 PropertyInvoker<T> in(java.lang.Object target)
          Returns a new property invoker.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_propertyName

private final java.lang.String _propertyName

_propertyType

private final TypeRef<T> _propertyType
Constructor Detail

PropertyTypes.PropertyTypeGenerics

PropertyTypes.PropertyTypeGenerics(java.lang.String name,
                                   TypeRef<T> type)
Method Detail

in

public PropertyInvoker<T> in(java.lang.Object target)
Returns a new property invoker. A property invoker is capable of accessing (read/write) the underlying property.

Parameters:
target - the object containing the property of interest.
Returns:
the created property invoker.
Throws:
java.lang.NullPointerException - if the given target is null.
ReflectionError - if a property with a matching name and type cannot be found.