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 Summary
ConstructorsConstructorDescriptionValueStackDataSource
(ValueStack valueStack, String dataSourceParam, boolean wrapField) Create a value stack data source on the given iterable property -
Method Summary
Modifier and TypeMethodDescriptiongetFieldValue
(net.sf.jasperreports.engine.JRField field) Get the value of a given fieldvoid
Move to the first item.boolean
next()
Is there any more data
-
Constructor Details
-
ValueStackDataSource
Create a value stack data source on the given iterable property- Parameters:
valueStack
- The value stack to base the data source ondataSourceParam
- The property to iterate over for the report
-
-
Method Details
-
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 interfacenet.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 isnull
.- Returns:
- an
Object
containing the field value or a newValueStackDataSource
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
-
moveFirst
public void moveFirst() throws net.sf.jasperreports.engine.JRExceptionMove to the first item.- Specified by:
moveFirst
in interfacenet.sf.jasperreports.engine.JRRewindableDataSource
- Throws:
net.sf.jasperreports.engine.JRException
- if there is a problem with moving to the first data element
-
next
public boolean next() throws net.sf.jasperreports.engine.JRExceptionIs there any more data- Specified by:
next
in interfacenet.sf.jasperreports.engine.JRDataSource
- Returns:
true
if there are more elements to iterate over andfalse
otherwise- Throws:
net.sf.jasperreports.engine.JRException
- if there is a problem determining whether there is more data
-