r01f.reflection.fluent
Class PropertyTypes.PropertyType<T>
java.lang.Object
r01f.reflection.fluent.PropertyTypes.PropertyType<T>
- Type Parameters:
T - the generic type of the property.
Usage example:
// Retrieves the value of the property "name"
String name = Reflection.property("name").ofType(String.class).in(person).get();
// Sets the value of the property "name" to "Yoda"
Reflection.property("name").ofType(String.class).in(person).set("Yoda");
- Enclosing class:
- PropertyTypes
public static class PropertyTypes.PropertyType<T>
- extends java.lang.Object
Understands the type of a property to access using Bean Instrospection.
|
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 |
_propertyName
private final java.lang.String _propertyName
_propertyType
private final java.lang.Class<T> _propertyType
PropertyTypes.PropertyType
PropertyTypes.PropertyType(java.lang.String propertyName,
java.lang.Class<T> type)
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.