net.sf.jasperreports.engine

## Class JRExpressionCollector

- java.lang.Object
- - net.sf.jasperreports.engine.JRExpressionCollector

-     public class JRExpressionCollector
      extends java.lang.Object

  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.

  Version:
    $Id: JRExpressionCollector.java 6934 2014-02-27 13:24:34Z lucianc $
  Author:
    Teodor Danciu (teodord@users.sourceforge.net)

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `protected static class` | `JRExpressionCollector.GeneratedIds`

  - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `JRExpressionCollector(JasperReportsContext jasperReportsContext, JRExpressionCollector parent, JRReport report)`
    `protected` | `JRExpressionCollector(JRExpressionCollector parent, JRReport report)` Deprecated. Replaced by `JRExpressionCollector(JasperReportsContext, JRExpressionCollector, JRReport)`.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addExpression(JRExpression expression)` Collects an expression.
    `java.util.Collection<JRExpression>` | `collect()`
    `protected void` | `collect(DataAxisLevel level, JRExpressionCollector datasetCollector)`
    `void` | `collect(JRAreaPlot areaPlot)`
    `void` | `collect(JRBar3DPlot barPlot)`
    `void` | `collect(JRBarPlot barPlot)`
    `void` | `collect(JRBreak breakElement)`
    `void` | `collect(JRBubblePlot bubblePlot)`
    `void` | `collect(JRCandlestickPlot candlestickPlot)`
    `void` | `collect(JRCategoryDataset categoryDataset)`
    `protected void` | `collect(JRCellContents cell)`
    `void` | `collect(JRChart chart)`
    `void` | `collect(JRComponentElement componentElement)` Collects expressions from a component element wrapper.
    `void` | `collect(JRCrosstab crosstab)` Collects expressions from a crosstab.
    `void` | `collect(JRDataRange dataRange)`
    `java.util.Collection<JRExpression>` | `collect(JRDataset dataset)` Collects expressions from a dataset.
    `void` | `collect(JRDatasetRun datasetRun)` Collects expressions from a subdataset run object.
    `void` | `collect(JRElementDataset dataset)` Collects expressions from an element dataset.
    `void` | `collect(JREllipse ellipse)`
    `void` | `collect(JRFrame frame)`
    `void` | `collect(JRGanttDataset ganttDataset)`
    `void` | `collect(JRGenericElement element)` Collects expressions from a generic element.
    `void` | `collect(JRHighLowDataset highLowDataset)`
    `void` | `collect(JRHighLowPlot highLowPlot)`
    `void` | `collect(JRImage image)`
    `void` | `collect(JRLine line)`
    `void` | `collect(JRLinePlot linePlot)`
    `void` | `collect(JRMeterPlot meterPlot)`
    `void` | `collect(JRPieDataset pieDataset)`
    `void` | `collect(JRRectangle rectangle)`
    `protected void` | `collect(JRReportTemplate template)`
    `void` | `collect(JRScatterPlot scatterPlot)`
    `void` | `collect(JRStaticText staticText)`
    `void` | `collect(JRStyle style)` Collects expressions used in a style definition.
    `void` | `collect(JRSubreport subreport)`
    `void` | `collect(JRTextField textField)`
    `void` | `collect(JRThermometerPlot thermometerPlot)`
    `void` | `collect(JRTimePeriodDataset timePeriodDataset)`
    `void` | `collect(JRTimeSeriesDataset timeSeriesDataset)`
    `void` | `collect(JRTimeSeriesPlot timeSeriesPlot)`
    `void` | `collect(JRValueDataset valueDataset)`
    `void` | `collect(JRXyDataset xyDataset)`
    `void` | `collect(JRXyzDataset xyzDataset)`
    `void` | `collect(MultiAxisData data)`
    `static java.util.List<JRExpression>` | `collectExpressions(JasperReportsContext jasperReportsContext, JRReport report)`
    `static java.util.List<JRExpression>` | `collectExpressions(JasperReportsContext jasperReportsContext, JRReport report, JRCrosstab crosstab)`
    `static java.util.List<JRExpression>` | `collectExpressions(JRReport report)` Deprecated. Replaced by `collectExpressions(JasperReportsContext, JRReport)`.
    `static java.util.List<JRExpression>` | `collectExpressions(JRReport report, JRCrosstab crosstab)` Deprecated. Replaced by `collectExpressions(JasperReportsContext, JRReport, JRCrosstab)`.
    `void` | `collectHyperlink(JRHyperlink hyperlink)`
    `protected void` | `collectHyperlinkParameter(JRHyperlinkParameter parameter)`
    `static JRExpressionCollector` | `collector(JasperReportsContext jasperReportsContext, JRReport report)`
    `static JRExpressionCollector` | `collector(JasperReportsContext jasperReportsContext, JRReport report, JRCrosstab crosstab)`
    `static JRExpressionCollector` | `collector(JRReport report)` Deprecated. Replaced by `collector(JasperReportsContext, JRReport)`.
    `static JRExpressionCollector` | `collector(JRReport report, JRCrosstab crosstab)` Deprecated. Replaced by `collector(JasperReportsContext, JRReport, JRCrosstab)`.
    `protected void` | `collectPropertyExpression(JRPropertyExpression propertyExpression)`
    `void` | `collectPropertyExpressions(JRPropertyExpression[] propertyExpressions)`
    `protected void` | `collectTemplates()`
    `JRExpressionCollector` | `getCollector(JRCrosstab crosstab)` Returns the expression collector for a crosstab.
    `JRExpressionCollector` | `getCollector(JRDataset dataset)` Returns the expression collector for a dataset.
    `JRExpressionCollector` | `getCollector(JRElementDataset elementDataset)` Returns the expression collector to which expressions in an element dataset belong.
    `java.lang.Integer` | `getCrosstabId(JRCrosstab crosstab)`
    `JRExpressionCollector` | `getDatasetCollector(java.lang.String datasetName)` Returns the expression collector for a report subdataset.
    `JRExpression` | `getExpression(int expressionId)`
    `java.lang.Object` | `getExpressionContext(JRExpression expression)`
    `java.lang.Integer` | `getExpressionId(JRExpression expression)`
    `java.util.List<JRExpression>` | `getExpressions()` Returns the collected expressions.
    `java.util.List<JRExpression>` | `getExpressions(JRCrosstab crosstab)` Returns the expressions collected for a crosstab.
    `java.util.List<JRExpression>` | `getExpressions(JRDataset dataset)` Returns the expressions collected for a dataset.
    `JasperReportsContext` | `getJasperReportsContext()`
    `java.util.Collection<JRExpression>` | `getReportExpressions()` Return all the expressions collected from the report.
    `protected java.lang.Object` | `popContextObject()`
    `protected void` | `pushContextObject(java.lang.Object context)`
    `protected void` | `setExpressionContext(JRExpression expression)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### JRExpressionCollector

          protected JRExpressionCollector(JRExpressionCollector parent,
                               JRReport report)

      Deprecated. Replaced by `JRExpressionCollector(JasperReportsContext, JRExpressionCollector, JRReport)`.

    - #### JRExpressionCollector

          protected JRExpressionCollector(JasperReportsContext jasperReportsContext,
                               JRExpressionCollector parent,
                               JRReport report)

  - ### Method Detail

    - #### collector

          public static JRExpressionCollector collector(JasperReportsContext jasperReportsContext,
                                        JRReport report)

    - #### collectExpressions

          public static java.util.List<JRExpression> collectExpressions(JasperReportsContext jasperReportsContext,
                                                        JRReport report)

    - #### collector

          public static JRExpressionCollector collector(JasperReportsContext jasperReportsContext,
                                        JRReport report,
                                        JRCrosstab crosstab)

    - #### collectExpressions

          public static java.util.List<JRExpression> collectExpressions(JasperReportsContext jasperReportsContext,
                                                        JRReport report,
                                                        JRCrosstab crosstab)

    - #### collector

          public static JRExpressionCollector collector(JRReport report)

      Deprecated. Replaced by `collector(JasperReportsContext, JRReport)`.

    - #### collectExpressions

          public static java.util.List<JRExpression> collectExpressions(JRReport report)

      Deprecated. Replaced by `collectExpressions(JasperReportsContext, JRReport)`.

    - #### collector

          public static JRExpressionCollector collector(JRReport report,
                                        JRCrosstab crosstab)

      Deprecated. Replaced by `collector(JasperReportsContext, JRReport, JRCrosstab)`.

    - #### collectExpressions

          public static java.util.List<JRExpression> collectExpressions(JRReport report,
                                                        JRCrosstab crosstab)

      Deprecated. Replaced by `collectExpressions(JasperReportsContext, JRReport, JRCrosstab)`.

    - #### addExpression

          public void addExpression(JRExpression expression)

      Collects an expression.
      Parameters:
        `expression` - the expression to collect

    - #### pushContextObject

          protected void pushContextObject(java.lang.Object context)

    - #### popContextObject

          protected java.lang.Object popContextObject()

    - #### setExpressionContext

          protected void setExpressionContext(JRExpression expression)

    - #### getCollector

          public JRExpressionCollector getCollector(JRElementDataset elementDataset)

      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

          public JRExpressionCollector getDatasetCollector(java.lang.String datasetName)

      Returns the expression collector for a report subdataset.
      Parameters:
        `datasetName` - the subdataset name
      Returns:
        the expression collector for the subdataset

    - #### getCollector

          public JRExpressionCollector getCollector(JRDataset dataset)

      Returns the expression collector for a dataset.
      Parameters:
        `dataset` - the dataset
      Returns:
        the dataset expression collector

    - #### getCollector

          public JRExpressionCollector getCollector(JRCrosstab crosstab)

      Returns the expression collector for a crosstab.
      Parameters:
        `crosstab` - the crosstab
      Returns:
        the crosstab expression collector

    - #### getExpressions

          public java.util.List<JRExpression> getExpressions()

      Returns the collected expressions.
      Returns:
        the collected expressions

    - #### getReportExpressions

          public java.util.Collection<JRExpression> getReportExpressions()

      Return all the expressions collected from the report.
      Returns:
        all the expressions collected from the report

    - #### getExpressions

          public java.util.List<JRExpression> getExpressions(JRDataset dataset)

      Returns the expressions collected for a dataset.
      Parameters:
        `dataset` - the dataset
      Returns:
        the expressions

    - #### getExpressions

          public java.util.List<JRExpression> getExpressions(JRCrosstab crosstab)

      Returns the expressions collected for a crosstab.
      Parameters:
        `crosstab` - the crosstab
      Returns:
        the expressions

    - #### getExpressionId

          public java.lang.Integer getExpressionId(JRExpression expression)

    - #### getExpression

          public JRExpression getExpression(int expressionId)

    - #### getCrosstabId

          public java.lang.Integer getCrosstabId(JRCrosstab crosstab)

    - #### getExpressionContext

          public java.lang.Object getExpressionContext(JRExpression expression)

    - #### collect

          public java.util.Collection<JRExpression> collect()

    - #### collectTemplates

          protected void collectTemplates()

    - #### collect

          protected void collect(JRReportTemplate template)

    - #### collect

          public void collect(JRStyle style)

      Collects expressions used in a style definition.
      Parameters:
        `style` - the style to collect expressions from

    - #### collectPropertyExpressions

          public void collectPropertyExpressions(JRPropertyExpression[] propertyExpressions)

    - #### collectPropertyExpression

          protected void collectPropertyExpression(JRPropertyExpression propertyExpression)

    - #### collectHyperlink

          public void collectHyperlink(JRHyperlink hyperlink)

    - #### collectHyperlinkParameter

          protected void collectHyperlinkParameter(JRHyperlinkParameter parameter)

    - #### collect

          public void collect(JRBreak breakElement)

    - #### collect

          public void collect(JRLine line)

    - #### collect

          public void collect(JRRectangle rectangle)

    - #### collect

          public void collect(JREllipse ellipse)

    - #### collect

          public void collect(JRImage image)

    - #### collect

          public void collect(JRStaticText staticText)

    - #### collect

          public void collect(JRTextField textField)

    - #### collect

          public void collect(JRSubreport subreport)

    - #### collect

          public void collect(JRChart chart)

    - #### collect

          public void collect(JRPieDataset pieDataset)

    - #### collect

          public void collect(JRCategoryDataset categoryDataset)

    - #### collect

          public void collect(JRXyDataset xyDataset)

    - #### collect

          public void collect(JRTimeSeriesDataset timeSeriesDataset)

    - #### collect

          public void collect(JRTimePeriodDataset timePeriodDataset)

    - #### collect

          public void collect(JRGanttDataset ganttDataset)

    - #### collect

          public void collect(JRValueDataset valueDataset)

    - #### collect

          public void collect(JRBarPlot barPlot)

    - #### collect

          public void collect(JRBar3DPlot barPlot)

    - #### collect

          public void collect(JRLinePlot linePlot)

    - #### collect

          public void collect(JRTimeSeriesPlot timeSeriesPlot)

    - #### collect

          public void collect(JRScatterPlot scatterPlot)

    - #### collect

          public void collect(JRAreaPlot areaPlot)

    - #### collect

          public void collect(JRXyzDataset xyzDataset)

    - #### collect

          public void collect(JRBubblePlot bubblePlot)

    - #### collect

          public void collect(JRHighLowPlot highLowPlot)

    - #### collect

          public void collect(JRDataRange dataRange)

    - #### collect

          public void collect(JRMeterPlot meterPlot)

    - #### collect

          public void collect(JRThermometerPlot thermometerPlot)

    - #### collect

          public void collect(JRHighLowDataset highLowDataset)

    - #### collect

          public void collect(JRCandlestickPlot candlestickPlot)

    - #### collect

          public void collect(JRCrosstab crosstab)

      Collects expressions from a crosstab.
      Parameters:
        `crosstab` - the crosstab

    - #### collect

          public java.util.Collection<JRExpression> collect(JRDataset dataset)

      Collects expressions from a dataset.
      Parameters:
        `dataset` - the dataset
      Returns:
        collected expressions

    - #### collect

          public void collect(JRElementDataset dataset)

      Collects expressions from an element dataset.
      Parameters:
        `dataset` - the element dataset

    - #### collect

          public void collect(JRDatasetRun datasetRun)

      Collects expressions from a subdataset run object.
      Parameters:
        `datasetRun` - the subdataset run

    - #### collect

          protected void collect(JRCellContents cell)

    - #### collect

          public void collect(JRFrame frame)

    - #### collect

          public void collect(JRComponentElement componentElement)

      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

          public void collect(JRGenericElement element)

      Collects expressions from a generic element.
      Parameters:
        `element` - the generic element

    - #### collect

          public void collect(MultiAxisData data)

    - #### collect

          protected void collect(DataAxisLevel level,
                     JRExpressionCollector datasetCollector)

    - #### getJasperReportsContext

          public JasperReportsContext getJasperReportsContext()

© 2001-2010 Jaspersoft Corporation www.jaspersoft.com