Class MethodCache

java.lang.Object
org.supercsv.util.MethodCache

public class MethodCache extends Object
This class cache's method lookups. Hence first time it introspects the instance's class, while subsequent method lookups are super fast.
  • Constructor Details

    • MethodCache

      public MethodCache()
  • Method Details

    • getGetMethod

      public Method getGetMethod(Object object, String fieldName)
      Returns the getter method for field on an object.
      Parameters:
      object - the object
      fieldName - the field name
      Returns:
      the getter associated with the field on the object
      Throws:
      NullPointerException - if object or fieldName is null
      SuperCsvReflectionException - if the getter doesn't exist or is not visible
    • getSetMethod

      public <T> Method getSetMethod(Object object, String fieldName, Class<?> argumentType)
      Returns the setter method for the field on an object.
      Type Parameters:
      T - the object type
      Parameters:
      object - the object
      fieldName - the field name
      argumentType - the type to be passed to the setter
      Returns:
      the setter method associated with the field on the object
      Throws:
      NullPointerException - if object, fieldName or fieldType is null
      SuperCsvReflectionException - if the setter doesn't exist or is not visible