Package net.sf.jasperreports.engine
Class JRExpressionCollector
java.lang.Object
net.sf.jasperreports.engine.JRExpressionCollector
An expression collector traverses a report and collects report expressions
out of it.
The expressions are then included into evaluator classes which are compiled and used at report fill time to evaluate expressions.
- Author:
- Teodor Danciu (teodord@users.sourceforge.net)
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static classprotected static classprotected static interfaceprotected static class -
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedJRExpressionCollector(JasperReportsContext jasperReportsContext, JRExpressionCollector parent, JRReport report) protectedJRExpressionCollector(JasperReportsContext jasperReportsContext, JRExpressionCollector parent, JRReport report, JRExpressionCollector.ExpressionVerifier expressionVerifier) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddExpression(JRExpression expression) Collects an expression.protected booleancanUseId(List<JRExpressionCollector> collectors, JRExpression expression, Integer id) protected booleancanUseId(JRExpression expression, Integer id) collect()protected voidcollect(JRCellContents cell) voidcollect(JRCrosstab crosstab) Collects expressions from a crosstab.protected voidcollect(DataAxisLevel level, JRExpressionCollector datasetCollector) voidcollect(MultiAxisData data) voidvoidcollect(JRComponentElement componentElement) Collects expressions from a component element wrapper.Collects expressions from a dataset.voidcollect(JRDatasetRun datasetRun) Collects expressions from a subdataset run object.voidcollect(JRElementDataset dataset) Collects expressions from an element dataset.voidvoidvoidcollect(JRGenericElement element) Collects expressions from a generic element.voidvoidvoidcollect(JRRectangle rectangle) protected voidcollect(JRReportTemplate template) voidcollect(JRStaticText staticText) voidCollects expressions used in a style definition.voidCollects expressions used in a style definition.voidcollect(JRSubreport subreport) voidcollect(JRTextField textField) voidcollectAnchor(JRAnchor anchor) voidcollectElement(JRElement element) static List<JRExpression> collectExpressions(JasperReportsContext jasperReportsContext, JRReport report) static List<JRExpression> collectExpressions(JasperReportsContext jasperReportsContext, JRReport report, JRCrosstab crosstab) Deprecated.To be removed.voidcollectHyperlink(JRHyperlink hyperlink) voidcollectHyperlinkParameter(JRHyperlinkParameter parameter) static JRExpressionCollectorcollector(JasperReportsContext jasperReportsContext, JRReport report) static JRExpressionCollectorcollector(JasperReportsContext jasperReportsContext, JRReport report, JRCrosstab crosstab) protected List<JRExpressionCollector> collectorsForExpression(Integer id, JRExpression expression) protected voidcollectPropertyExpression(JRPropertyExpression propertyExpression) voidcollectPropertyExpressions(JRPropertyExpression[] propertyExpressions) protected voidgetCollector(JRCrosstab crosstab) Returns the expression collector for a crosstab.getCollector(JRDataset dataset) Returns the expression collector for a dataset.getCollector(JRElementDataset elementDataset) Returns the expression collector to which expressions in an element dataset belong.getCrosstabId(JRCrosstab crosstab) getDatasetCollector(String datasetName) Returns the expression collector for a report subdataset.getExpression(int expressionId) getExpressionContext(JRExpression expression) getExpressionId(JRExpression expression) Returns the collected expressions.getExpressions(JRCrosstab crosstab) Returns the expressions collected for a crosstab.getExpressions(JRDataset dataset) Returns the expressions collected for a dataset.Return all the expressions collected from the report.protected booleanhasExpression(Integer id, JRExpression expression) protected Objectprotected voidpushContextObject(Object context) protected voidreassignId(JRExpression expression, Integer id) protected JRExpressionCollectorprotected voidsetExpressionContext(JRExpression expression)
-
Field Details
-
EXCEPTION_MESSAGE_KEY_EXPRESSION_NOT_FOUND
- See Also:
-
EXCEPTION_MESSAGE_KEY_TWO_GENERATED_IDS
- See Also:
-
-
Constructor Details
-
JRExpressionCollector
protected JRExpressionCollector(JasperReportsContext jasperReportsContext, JRExpressionCollector parent, JRReport report) -
JRExpressionCollector
protected JRExpressionCollector(JasperReportsContext jasperReportsContext, JRExpressionCollector parent, JRReport report, JRExpressionCollector.ExpressionVerifier expressionVerifier)
-
-
Method Details
-
collector
public static JRExpressionCollector collector(JasperReportsContext jasperReportsContext, JRReport report) -
collectExpressions
public static List<JRExpression> collectExpressions(JasperReportsContext jasperReportsContext, JRReport report) -
collector
public static JRExpressionCollector collector(JasperReportsContext jasperReportsContext, JRReport report, JRCrosstab crosstab) -
collectExpressions
public static List<JRExpression> collectExpressions(JasperReportsContext jasperReportsContext, JRReport report, JRCrosstab crosstab) Deprecated.To be removed. -
addExpression
Collects an expression.- Parameters:
expression- the expression to collect
-
canUseId
-
reassignId
-
canUseId
protected boolean canUseId(List<JRExpressionCollector> collectors, JRExpression expression, Integer id) -
rootCollector
-
hasExpression
-
collectorsForExpression
-
pushContextObject
-
popContextObject
-
setExpressionContext
-
getCollector
Returns the expression collector to which expressions in an element dataset belong.If the element dataset includes a subdataset run, a (sub) expression collector that corresponds to the subdataset will be returned. Otherwise, this/the main expression collector will be returned.
- Parameters:
elementDataset- an element dataset- Returns:
- the expression collector to be used for the element dataset
-
getDatasetCollector
Returns the expression collector for a report subdataset.- Parameters:
datasetName- the subdataset name- Returns:
- the expression collector for the subdataset
-
getCollector
Returns the expression collector for a dataset.- Parameters:
dataset- the dataset- Returns:
- the dataset expression collector
-
getCollector
Returns the expression collector for a crosstab.- Parameters:
crosstab- the crosstab- Returns:
- the crosstab expression collector
-
getExpressions
Returns the collected expressions.- Returns:
- the collected expressions
-
getReportExpressions
Return all the expressions collected from the report.- Returns:
- all the expressions collected from the report
-
getExpressions
Returns the expressions collected for a dataset.- Parameters:
dataset- the dataset- Returns:
- the expressions
-
getExpressions
Returns the expressions collected for a crosstab.- Parameters:
crosstab- the crosstab- Returns:
- the expressions
-
getExpressionId
-
getExpression
-
getCrosstabId
-
getExpressionContext
-
collect
-
collectTemplates
protected void collectTemplates() -
collect
-
collect
Collects expressions used in a style definition.- Parameters:
style- the style to collect expressions from
-
collect
Collects expressions used in a style definition.- Parameters:
style- the style to collect expressions from
-
collectElement
-
collectPropertyExpressions
-
collectPropertyExpression
-
collectAnchor
-
collectHyperlink
-
collectHyperlinkParameter
-
collect
-
collect
-
collect
-
collect
-
collect
-
collect
-
collect
-
collect
-
collect
Collects expressions from a crosstab.- Parameters:
crosstab- the crosstab
-
collect
Collects expressions from a dataset.- Parameters:
dataset- the dataset- Returns:
- collected expressions
-
collect
Collects expressions from an element dataset.- Parameters:
dataset- the element dataset
-
collect
Collects expressions from a subdataset run object.- Parameters:
datasetRun- the subdataset run
-
collect
-
collect
-
collect
Collects expressions from a component element wrapper.Common element expressions are collected, and then the component compiler's
ComponentCompiler.collectExpressions(Component, JRExpressionCollector)is called to collect component expressions.- Parameters:
componentElement- the component element
-
collect
Collects expressions from a generic element.- Parameters:
element- the generic element
-
collect
-
collect
-
getJasperReportsContext
-