Class JRFillElementDataset
- java.lang.Object
-
- net.sf.jasperreports.engine.fill.JRFillElementDataset
-
- All Implemented Interfaces:
Cloneable
,DatasetRunHolder
,JRCloneable
,JRElementDataset
- Direct Known Subclasses:
FillItemDataset
,FillMultiAxisDataset
,FillSpiderDataset
,JRFillChartDataset
,JRFillCrosstab.JRFillCrosstabDataset
public abstract class JRFillElementDataset extends Object implements JRElementDataset
AbstractJRElementDataset
implementation used at report fill time.A dataset implementation usually involves a set of expressions which are used to feed data to some internal data structures. The collected data is then transformed into report output. An implementation needs to implement abstract methods that initialize, evaluate and increment the dataset.
- Author:
- Teodor Danciu (teodord@users.sourceforge.net)
- See Also:
JRFillObjectFactory.registerElementDataset(JRFillElementDataset)
-
-
Field Summary
Fields Modifier and Type Field Description protected JRFillDatasetRun
datasetRun
protected String
incrementGroup
protected JRElementDataset
parent
protected String
resetGroup
-
Constructor Summary
Constructors Modifier Constructor Description protected
JRFillElementDataset(JRFillElementDataset dataset, JRFillCloneFactory factory)
protected
JRFillElementDataset(JRElementDataset dataset, JRFillObjectFactory factory)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description Object
clone()
protected abstract void
customEvaluate(JRCalculator calculator)
Evaluates the expressions associated with the dataset.protected abstract void
customIncrement()
Increments the dataset by collecting the result of the expression evaluation.protected abstract void
customInitialize()
Initializes the element dataset.protected void
evaluate(JRCalculator calculator)
void
evaluateDatasetRun(byte evaluation)
protected void
evaluateIncrementWhenExpression(JRCalculator calculator)
DatasetResetTypeEnum
getDatasetResetType()
Gets the reset type.JRDatasetRun
getDatasetRun()
Returns the sub dataset run for this chart dataset.JRFillDataset
getFillDataset()
protected JRBaseFiller
getFiller()
String
getIncrementGroup()
Gets the selected increment group in case of increment type group.IncrementTypeEnum
getIncrementType()
Returns the increment type.JRExpression
getIncrementWhenExpression()
Returns the "increment when" expression.JRFillDataset
getInputDataset()
protected Locale
getLocale()
String
getResetGroup()
Gets the selected reset group in case of reset type group.protected TimeZone
getTimeZone()
protected void
increment()
protected void
initialize()
void
setBand(JRFillBand band)
-
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface net.sf.jasperreports.engine.JRElementDataset
collectExpressions
-
-
-
-
Field Detail
-
parent
protected JRElementDataset parent
-
resetGroup
protected String resetGroup
-
incrementGroup
protected String incrementGroup
-
datasetRun
protected JRFillDatasetRun datasetRun
-
-
Constructor Detail
-
JRFillElementDataset
protected JRFillElementDataset(JRElementDataset dataset, JRFillObjectFactory factory)
-
JRFillElementDataset
protected JRFillElementDataset(JRFillElementDataset dataset, JRFillCloneFactory factory)
-
-
Method Detail
-
setBand
public void setBand(JRFillBand band)
-
getDatasetResetType
public DatasetResetTypeEnum getDatasetResetType()
Description copied from interface:JRElementDataset
Gets the reset type. This specifies the range of report data used for filling the dataset.- Specified by:
getDatasetResetType
in interfaceJRElementDataset
- Returns:
- one of the reset constants in
DatasetResetTypeEnum
-
getIncrementType
public IncrementTypeEnum getIncrementType()
Description copied from interface:JRElementDataset
Returns the increment type. This specifies dataset values increment step.- Specified by:
getIncrementType
in interfaceJRElementDataset
- Returns:
- one of the increment constants in
IncrementTypeEnum
.
-
getResetGroup
public String getResetGroup()
Description copied from interface:JRElementDataset
Gets the selected reset group in case of reset type group.- Specified by:
getResetGroup
in interfaceJRElementDataset
-
getIncrementGroup
public String getIncrementGroup()
Description copied from interface:JRElementDataset
Gets the selected increment group in case of increment type group.- Specified by:
getIncrementGroup
in interfaceJRElementDataset
-
getFiller
protected JRBaseFiller getFiller()
-
getLocale
protected Locale getLocale()
-
getTimeZone
protected TimeZone getTimeZone()
-
initialize
protected void initialize()
-
evaluate
protected void evaluate(JRCalculator calculator) throws JRExpressionEvalException
- Throws:
JRExpressionEvalException
-
evaluateIncrementWhenExpression
protected void evaluateIncrementWhenExpression(JRCalculator calculator) throws JRExpressionEvalException
- Throws:
JRExpressionEvalException
-
increment
protected void increment()
-
customInitialize
protected abstract void customInitialize()
Initializes the element dataset.The dataset is initialized before being used and after each time the dataset gets reset.
- See Also:
getDatasetResetType()
-
customEvaluate
protected abstract void customEvaluate(JRCalculator calculator) throws JRExpressionEvalException
Evaluates the expressions associated with the dataset.Usually, the result of the evaluation would be preserved so that it is used in
customIncrement()
- Parameters:
calculator
- used to evaluate expressions- Throws:
JRExpressionEvalException
- any exception that occurs while evaluating expressions
-
customIncrement
protected abstract void customIncrement()
Increments the dataset by collecting the result of the expression evaluation.
-
getDatasetRun
public JRDatasetRun getDatasetRun()
Description copied from interface:JRElementDataset
Returns the sub dataset run for this chart dataset.- Specified by:
getDatasetRun
in interfaceDatasetRunHolder
- Specified by:
getDatasetRun
in interfaceJRElementDataset
- Returns:
- the sub dataset run for this chart dataset
-
evaluateDatasetRun
public void evaluateDatasetRun(byte evaluation) throws JRException
- Throws:
JRException
-
getInputDataset
public JRFillDataset getInputDataset()
-
getIncrementWhenExpression
public JRExpression getIncrementWhenExpression()
Description copied from interface:JRElementDataset
Returns the "increment when" expression.This expression determines whether a dataset will be incremented or not.
The expression (if not null) is evaluated before each increment of the dataset. The increment will be carried on only when the result of the evaluation is
Boolean.TRUE
; if the result is null or false, the increment will not be performed.- Specified by:
getIncrementWhenExpression
in interfaceJRElementDataset
- Returns:
- the "increment when" expression
-
clone
public Object clone()
- Specified by:
clone
in interfaceJRCloneable
- Overrides:
clone
in classObject
-
getFillDataset
public JRFillDataset getFillDataset()
-
-