Class ValueStackDataSource
java.lang.Object
org.apache.struts2.views.jasperreports.ValueStackDataSource
- All Implemented Interfaces:
- net.sf.jasperreports.engine.JRDataSource,- net.sf.jasperreports.engine.JRRewindableDataSource
public class ValueStackDataSource
extends Object
implements net.sf.jasperreports.engine.JRRewindableDataSource
Ported to Struts.
- 
Constructor SummaryConstructorsConstructorDescriptionValueStackDataSource(ValueStack valueStack, String dataSourceParam, boolean wrapField) Create a value stack data source on the given iterable property
- 
Method SummaryModifier and TypeMethodDescriptiongetFieldValue(net.sf.jasperreports.engine.JRField field) Get the value of a given fieldvoidMove to the first item.booleannext()Is there any more data
- 
Constructor Details- 
ValueStackDataSourceCreate a value stack data source on the given iterable property- Parameters:
- valueStack- The value stack to base the data source on
- dataSourceParam- The property to iterate over for the report
 
 
- 
- 
Method Details- 
getFieldValuepublic Object getFieldValue(net.sf.jasperreports.engine.JRField field) throws net.sf.jasperreports.engine.JRException Get the value of a given field- Specified by:
- getFieldValuein 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 Objectcontaining the field value or a newValueStackDataSourceobject 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
 
- 
moveFirstpublic void moveFirst() throws net.sf.jasperreports.engine.JRExceptionMove to the first item.- Specified by:
- moveFirstin interface- net.sf.jasperreports.engine.JRRewindableDataSource
- Throws:
- net.sf.jasperreports.engine.JRException- if there is a problem with moving to the first data element
 
- 
nextpublic boolean next() throws net.sf.jasperreports.engine.JRExceptionIs there any more data- Specified by:
- nextin interface- net.sf.jasperreports.engine.JRDataSource
- Returns:
- trueif there are more elements to iterate over and- falseotherwise
- Throws:
- net.sf.jasperreports.engine.JRException- if there is a problem determining whether there is more data
 
 
-