com.opensymphony.webwork.views.jasperreports
Class OgnlValueStackDataSource

java.lang.Object
  extended bycom.opensymphony.webwork.views.jasperreports.OgnlValueStackDataSource
All Implemented Interfaces:
net.sf.jasperreports.engine.JRDataSource

public class OgnlValueStackDataSource
extends Object
implements net.sf.jasperreports.engine.JRDataSource

Ported to WebWork2.

Version:
$Id: OgnlValueStackDataSource.java,v 1.6 2004/12/05 22:19:44 mbogaert Exp $
Author:
<a href="hermanns@aixcept.de">Rainer Hermanns</a>

Constructor Summary
OgnlValueStackDataSource(com.opensymphony.xwork.util.OgnlValueStack valueStack, String dataSource)
          Create a value stack data source on the given iterable property
 
Method Summary
 Object getFieldValue(net.sf.jasperreports.engine.JRField field)
          Get the value of a given field
 boolean next()
          Is there any more data
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OgnlValueStackDataSource

public OgnlValueStackDataSource(com.opensymphony.xwork.util.OgnlValueStack valueStack,
                                String dataSource)
Create a value stack data source on the given iterable property

Parameters:
valueStack - The value stack to base the data source on
dataSource - The property to iterate over for the report
Method Detail

getFieldValue

public Object getFieldValue(net.sf.jasperreports.engine.JRField field)
                     throws net.sf.jasperreports.engine.JRException
Get the value of a given field

Specified by:
getFieldValue in interface net.sf.jasperreports.engine.JRDataSource
Parameters:
field - The field to get the value for. The expression language to get the value of the field is either taken from the description property or from the name of the field if the description is null.
Returns:
an Object containing the field value or a new OgnlValueStackDataSource object if the field value evaluates to an object that can be iterated over.
Throws:
net.sf.jasperreports.engine.JRException - if there is a problem obtaining the value

next

public boolean next()
             throws net.sf.jasperreports.engine.JRException
Is there any more data

Specified by:
next in interface net.sf.jasperreports.engine.JRDataSource
Returns:
true if there are more elements to iterate over and false otherwise
Throws:
net.sf.jasperreports.engine.JRException - if there is a problem determining whether there is more data

WebWork Project Page