A TableDataProvider implementation to wrap the return value from a method.
Set the dataClassInstance, dataMethod, and
dataMethodArguments properties to point to a method on a class
instance. The result from that method call will be wrapped as a
TableDataProvider, with a row for each element in the returned array or
collection. If there is only a single return value, it will be a single row
table.
author: cao, Joe Nuxoll
Constructor Summary
public
MethodResultTableDataProvider() Constructs a new MethodResultTableDataProvider with no dataClassInstance
or dataMethod specified.
public
MethodResultTableDataProvider(Object dataClassInstance, Method dataMethod) Constructs a new MethodResultTableDataProvider using the specified
dataClassInstance and dataMethod.
setCollectionElementType(Class elementType) If the dataMethod returns a Collection type, this property
will be used to determine the appropriate FieldKeys for the elements in
the collection type.
Constructs a new MethodResultTableDataProvider with no dataClassInstance
or dataMethod specified.
MethodResultTableDataProvider
public MethodResultTableDataProvider(Object dataClassInstance, Method dataMethod)(Code)
Constructs a new MethodResultTableDataProvider using the specified
dataClassInstance and dataMethod.
Parameters: dataClassInstance - The class instance where the method is invoked Parameters: dataMethod - The method where the data is from
public void setCollectionElementType(Class elementType)(Code)
If the dataMethod returns a Collection type, this property
will be used to determine the appropriate FieldKeys for the elements in
the collection type.
Parameters: elementType - Class
Sets the dataMethod that will be invoked
Parameters: method - Method
setDataMethodArguments
public void setDataMethodArguments(Object[] methodArgs)(Code)
Sets the dataMethodArguments, which will be passed to the dataMethod
when it is invoked.
Parameters: methodArgs - Object[]
setIncludeFields
public void setIncludeFields(boolean includeFields)(Code)
Sets the includeFields property. This affects the set of
FieldKey s that this
com.sun.data.provider.DataProvider emits.
If includeFields is set to true (the default), then public fields will
be included in the list of available keys (intermixed with the public
properties). If it is set to false, then only the public properties
will be available.
Parameters: includeFields - true to include the public fields, orfalse to exclude them (and only show publicproperties)