r01f.reflection.fluent
Class FieldTypes.FieldType<T>

java.lang.Object
  extended by r01f.reflection.fluent.FieldTypes.FieldType<T>
Type Parameters:
T - the generic type of the field. Usage example:
 // Retrieves the value of the field "name"
 String name = Reflection.field("name").ofType(String.class).in(person).get();
 // Sets the value of the field "name" to "Yoda"
 Reflection.field("name").ofType(String.class).in(person).set("Yoda");
 
Enclosing class:
FieldTypes

public static class FieldTypes.FieldType<T>
extends java.lang.Object

Encapsulates a Field type


Field Summary
(package private)  java.lang.String _fieldName
           
(package private)  java.lang.Class<T> _fieldType
           
 
Constructor Summary
FieldTypes.FieldType(java.lang.String fieldName, java.lang.Class<T> fieldType)
           
 
Method Summary
 FieldInvoker<T> in(java.lang.Object target)
          Returns a new field access invoker, capable of accessing (read/write) the underlying field.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_fieldName

final java.lang.String _fieldName

_fieldType

final java.lang.Class<T> _fieldType
Constructor Detail

FieldTypes.FieldType

FieldTypes.FieldType(java.lang.String fieldName,
                     java.lang.Class<T> fieldType)
Method Detail

in

public FieldInvoker<T> in(java.lang.Object target)
Returns a new field access invoker, capable of accessing (read/write) the underlying field.

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