(no commit message)
[utils] / support / general / src / main / java / org / wamblee / reflection / FieldAccessor.java
index 0157a71c60a69f9b63be301f501417f674d56181..1df4169f1a146f0839e0f6ce05f9968466412335 100644 (file)
@@ -17,20 +17,22 @@ package org.wamblee.reflection;
 
 import java.lang.reflect.Field;
 
-
 /**
- * Utility for interfacing to a field of an object. 
+ * Utility for interfacing to a field of an object.
  * 
  * @author Erik Brakkee
- *
- * @param <T> Type of the field. 
+ * 
+ * @param <T>
+ *            Type of the field.
  */
 public class FieldAccessor<T> implements Accessor<T> {
     private Field field;
 
     /**
-     * Constructs the accessor. 
-     * @param aField Field. 
+     * Constructs the accessor.
+     * 
+     * @param aField
+     *            Field.
      */
     public FieldAccessor(Field aField) {
         field = aField;
@@ -57,15 +59,21 @@ public class FieldAccessor<T> implements Accessor<T> {
     }
 
     /**
-     * Gets the field. 
-     * @return Field. 
+     * Gets the field.
+     * 
+     * @return Field.
      */
     public Field getField() {
         return field;
     }
-    
+
+    @Override
+    public Class<T> getType() {
+        return (Class<T>) field.getType();
+    }
+
     @Override
     public String toString() {
-        return "fieldInjection(" + field + ")"; 
+        return "fieldInjection(" + field + ")";
     }
 }
\ No newline at end of file