Package org.supercsv.util
Class MethodCache
- java.lang.Object
-
- org.supercsv.util.MethodCache
-
public class MethodCache extends java.lang.ObjectThis class cache's method lookups. Hence first time it introspects the instance's class, while subsequent method lookups are super fast.
-
-
Constructor Summary
Constructors Constructor Description MethodCache()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.reflect.MethodgetGetMethod(java.lang.Object object, java.lang.String fieldName)Returns the getter method for field on an object.<T> java.lang.reflect.MethodgetSetMethod(java.lang.Object object, java.lang.String fieldName, java.lang.Class<?> argumentType)Returns the setter method for the field on an object.
-
-
-
Method Detail
-
getGetMethod
public java.lang.reflect.Method getGetMethod(java.lang.Object object, java.lang.String fieldName)Returns the getter method for field on an object.- Parameters:
object- the objectfieldName- the field name- Returns:
- the getter associated with the field on the object
- Throws:
java.lang.NullPointerException- if object or fieldName is nullSuperCsvReflectionException- if the getter doesn't exist or is not visible
-
getSetMethod
public <T> java.lang.reflect.Method getSetMethod(java.lang.Object object, java.lang.String fieldName, java.lang.Class<?> argumentType)Returns the setter method for the field on an object.- Type Parameters:
T- the object type- Parameters:
object- the objectfieldName- the field nameargumentType- the type to be passed to the setter- Returns:
- the setter method associated with the field on the object
- Throws:
java.lang.NullPointerException- if object, fieldName or fieldType is nullSuperCsvReflectionException- if the setter doesn't exist or is not visible
-
-