|
Docmosis API 4.9.0 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.docmosis.template.population.DataProviderFactory
public class DataProviderFactory
A convenience class for creating, building and extending DataProviders to feed templates.
| Constructor Summary | |
|---|---|
DataProviderFactory()
|
|
| Method Summary | |
|---|---|
static SQLDataProvider |
addToDataProvider(SQLDataProvider mdp,
ResultSet results,
DataProviderGrouping[] grouping)
Alter a hierarchical data provider by adding data based on a given SQL result set. |
static SQLDataProvider |
addToDataProvider(SQLDataProvider dp,
ResultSet results,
String dpRowName)
Alter a simple data provider by adding data based on a given SQL result set. |
static CompoundDataProvider |
createCompoundDataProvider(DataProvider[] providers)
Create a CompoundDataProvider from the given array of DataProviders. |
static CompoundDataProvider |
createCompoundDataProvider(List providers)
Create a CompoundDataProvider from the given List of Objects. |
static ReflectiveDataProvider |
createDataProvider(Object delegate)
Create a Reflective data provider that extracts data from the given This data providers is forgiving (see ReflectiveDataProvider for more details). |
static ReflectiveDataProvider |
createDataProvider(Object delegate,
boolean forgiving)
Create a Reflective data provider that extracts data from the given Object and is optionally forgiving (see ReflectiveDataProvider for more details). |
static SQLDataProvider |
createDataProvider(ResultSet results,
DataProviderGrouping[] grouping)
Create a hierarchical data provider for a given SQL result set. |
static SQLDataProvider |
createDataProvider(ResultSet results,
String dpRowName)
Create a simple data provider for a given SQL result set. |
static MutableDataProvider |
createDataProvider(String[][] keyValuePairs)
Create a hierarchical data provider for the given arrangement of key value pairs. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DataProviderFactory()
| Method Detail |
|---|
public static SQLDataProvider createDataProvider(ResultSet results,
String dpRowName)
throws SQLException
results - the result set to populate the data provider with.dpRowName - the name of the data provider for each row in the result set.
In the diagram, this is the name of the data provider denoted by (row-data-provider).
SQLException - if an error occurs reading from the result set.
public static SQLDataProvider addToDataProvider(SQLDataProvider dp,
ResultSet results,
String dpRowName)
throws SQLException
dp - the SQL data provider to alter. This is mutated to the very
same as the return value.results - he result set to populate the data provider with.dpRowName - the name of the data provider for each row in the result set.
In the diagram, this is the name of the data provider denoted by (row-data-provider).
SQLException - if an error occurs reading from the result set.
public static SQLDataProvider createDataProvider(ResultSet results,
DataProviderGrouping[] grouping)
throws SQLException,
DataProviderGroupingException
results - the result set to populate the data provider with.grouping - the various groupings for the data to be laid out in.
Each element in the array represents the parent group of the next
element.
SQLException - if an error occurs reading from the result set.
DataProviderGroupingException - if the groupings are invalid.
public static SQLDataProvider addToDataProvider(SQLDataProvider mdp,
ResultSet results,
DataProviderGrouping[] grouping)
throws SQLException,
DataProviderGroupingException
mdp - the memory data provider to alter. This is mutated to the very
same as the return value.results - he result set to populate the data provider with.
SQLException - if an error occurs reading from the result set.
DataProviderGroupingExceptionpublic static ReflectiveDataProvider createDataProvider(Object delegate)
delegate - the object to reflect upon to get values.
ReflectiveDataProvider
public static ReflectiveDataProvider createDataProvider(Object delegate,
boolean forgiving)
delegate - the object to reflect upon to get values.forgiving - if false, any call into the delegate that results in
no data being found throws an IllegalArgumentException (mostly for debugging)
ReflectiveDataProviderpublic static CompoundDataProvider createCompoundDataProvider(DataProvider[] providers)
providers - the DataProviders to compound into one DataProvider
CompoundDataProviderpublic static CompoundDataProvider createCompoundDataProvider(List providers)
providers - the DataProviders to compound into one DataProvider
CompoundDataProviderpublic static MutableDataProvider createDataProvider(String[][] keyValuePairs)
keyValuePairs - the key value pairs where the key is
a flat mapping to get to a hierarchically structured part
of the memory data provider. The value is the actual
value for the key.
|
Docmosis API 4.9.0 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||