Package net.sf.jasperreports.engine.data
Class JRAbstractBeanDataSourceProvider
- java.lang.Object
-
- net.sf.jasperreports.engine.data.JRAbstractBeanDataSourceProvider
-
- All Implemented Interfaces:
JRDataSourceProvider
public abstract class JRAbstractBeanDataSourceProvider extends Object implements JRDataSourceProvider
The base implementation for JRBeanXXXDataSource providers. It provides a common implementation for bean properties introspection.- Author:
- Peter Severin (peter_s@sourceforge.net, contact@jasperassistant.com)
-
-
Field Summary
Fields Modifier and Type Field Description static String
EXCEPTION_MESSAGE_KEY_NULL_BEAN_CLASS
-
Constructor Summary
Constructors Constructor Description JRAbstractBeanDataSourceProvider(Class<?> beanClass)
Creates the provider.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description JRField[]
getFields(JasperReport report)
Returns the fields that are available from the data source.boolean
supportsGetFieldsOperation()
Returns true if the provider supports thegetFields
operation.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface net.sf.jasperreports.engine.JRDataSourceProvider
create, dispose
-
-
-
-
Field Detail
-
EXCEPTION_MESSAGE_KEY_NULL_BEAN_CLASS
public static final String EXCEPTION_MESSAGE_KEY_NULL_BEAN_CLASS
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
JRAbstractBeanDataSourceProvider
public JRAbstractBeanDataSourceProvider(Class<?> beanClass)
Creates the provider. Superclasses must pass a valid class that will be used to introspect the available bean fields.- Parameters:
beanClass
- the bean class to be introspected.
-
-
Method Detail
-
supportsGetFieldsOperation
public boolean supportsGetFieldsOperation()
Description copied from interface:JRDataSourceProvider
Returns true if the provider supports thegetFields
operation. By returning true in this method the data source provider indicates that it is able to introspect the data source and discover the available fields.- Specified by:
supportsGetFieldsOperation
in interfaceJRDataSourceProvider
- Returns:
- true if the getFields() operation is supported.
- See Also:
JRDataSourceProvider.supportsGetFieldsOperation()
-
getFields
public JRField[] getFields(JasperReport report) throws JRException
Description copied from interface:JRDataSourceProvider
Returns the fields that are available from the data source. The provider can use the passed in report to extract some additional configuration information such as report properties.- Specified by:
getFields
in interfaceJRDataSourceProvider
- Parameters:
report
- the report that will be filled using the data source created by this provider. The passed in report can be null. That means that no compiled report is available yet.- Returns:
- a non null fields array. If there are no fields then an empty array must be returned.
- Throws:
JRException
- if an error occurs.- See Also:
JRDataSourceProvider.getFields(net.sf.jasperreports.engine.JasperReport)
-
-