Class MethodDataSource

    • Constructor Detail

      • MethodDataSource

        public MethodDataSource​(String id,
                                Class<?> clazz,
                                String methodName)
        Creates a MethodDataSource that will call the named method on objects of the specified type. The method must not return void and must take 0 arguments.
        Parameters:
        id - a unique identifier for this DataSource.
        clazz - the object type
        methodName - the name of the method to call
    • Method Detail

      • getMethod

        public net.sf.cglib.reflect.FastMethod getMethod()
        Gets the FastMethod that this MethodDataSource will invoke on a "get".
        Returns:
        the FastMethod that this MethodDataSource will invoke on a "get".
      • getDataType

        public Class<?> getDataType()
        Description copied from interface: DataSource
        Gets the type of data produced by this DataSource.
        Specified by:
        getDataType in interface DataSource
        Returns:
        the type of data produced by this DataSource.
      • getId

        public String getId()
        Description copied from interface: DataSource
        Gets the unique id of this DataSource. The id should be unique across the DataSet that this source is added to.
        Specified by:
        getId in interface DataSource
        Returns:
        the unique id of this DataSource.
      • getSourceType

        public Class<?> getSourceType()
        Description copied from interface: DataSource
        Gets the type of the object that this DataSource can retreive data from.
        Specified by:
        getSourceType in interface DataSource
        Returns:
        the type of the object that this DataSource can retreive data from.
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object