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 java.lang.Object
      implements JRDataSourceProvider

  The base implementation for JRBeanXXXDataSource providers. It provides a common implementation for bean properties introspection.
  Version:
    $Id: JRAbstractBeanDataSourceProvider.java 5878 2013-01-07 20:23:13Z teodord $
  Author:
    Peter Severin (peter_s@sourceforge.net, contact@jasperassistant.com)

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `JRAbstractBeanDataSourceProvider(java.lang.Class<?> beanClass)` Creates the provider.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `JRField[]` | `getFields(JasperReport report)` Returns the fields that are available from the data source.
    `boolean` | `supportsGetFieldsOperation()` Returns true if the provider supports the `getFields` 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`

- - ### Constructor Detail

    - #### JRAbstractBeanDataSourceProvider

          public JRAbstractBeanDataSourceProvider(java.lang.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 the `getFields` 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 interface `JRDataSourceProvider`
      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 interface `JRDataSourceProvider`
      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)`

© 2001-2010 Jaspersoft Corporation www.jaspersoft.com