org.fest.reflect.beanproperty
Class PropertyType<T>

java.lang.Object
  extended by org.fest.reflect.beanproperty.PropertyType<T>
Type Parameters:
T - the generic type of the property.

public class PropertyType<T>
extends Object

Understands the type of a property to access using Bean Instrospection.

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

   // Retrieves the value of the property "name"
   String name = property("name").ofType(String.class).in(person).get();

   // Sets the value of the property "name" to "Yoda"
   property("name").ofType(String.class).in(person).set("Yoda");
 

Since:
1.2
Author:
Alex Ruiz

Method Summary
 Invoker<T> in(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
 

Method Detail

in

public Invoker<T> in(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:
NullPointerException - if the given target is null.
ReflectionError - if a property with a matching name and type cannot be found.


Copyright © 2007-2010 FEST (Fixtures for Easy Software Testing). All Rights Reserved.