Class TocDataGeneratorFunction
- java.lang.Object
-
- org.pentaho.reporting.engine.classic.core.function.AbstractExpression
-
- org.pentaho.reporting.engine.classic.core.function.AbstractFunction
-
- org.pentaho.reporting.engine.classic.extensions.toc.TocDataGeneratorFunction
-
- All Implemented Interfaces:
Serializable
,Cloneable
,EventListener
,org.pentaho.reporting.engine.classic.core.event.PageEventListener
,org.pentaho.reporting.engine.classic.core.event.ReportListener
,org.pentaho.reporting.engine.classic.core.function.Expression
,org.pentaho.reporting.engine.classic.core.function.Function
public class TocDataGeneratorFunction extends org.pentaho.reporting.engine.classic.core.function.AbstractFunction implements org.pentaho.reporting.engine.classic.core.event.PageEventListener
A data-collector that collects table-of-contents items at group-starts. The function collects these items accross subreport boundaries.- Author:
- Thomas Morgner.
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description TocDataGeneratorFunction()
Creates an unnamed function.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Object
clone()
Clones the expression.int
getDependencyLevel()
Returns the dependency level for the expression (controls evaluation order for expressions and functions).String[]
getGroup()
Returns all defined groups as array of strings.String
getGroup(int index)
Returns the defined field at the given index-position.int
getGroupCount()
Returns the number of groups defined in this expression.String
getIndexSeparator()
org.pentaho.reporting.engine.classic.core.function.Expression
getInstance()
Return a completly separated copy of this function.org.pentaho.reporting.engine.classic.core.util.TypedTableModel
getModel()
String
getTitleField()
String
getTitleFormula()
Object
getValue()
Return the current expression value.void
groupFinished(org.pentaho.reporting.engine.classic.core.event.ReportEvent event)
Receives notification that a group has finished.void
groupStarted(org.pentaho.reporting.engine.classic.core.event.ReportEvent event)
boolean
isCollectDetails()
boolean
isDeepTraversing()
Checks whether this expression is a deep-traversing expression.void
itemsAdvanced(org.pentaho.reporting.engine.classic.core.event.ReportEvent event)
Receives notification that a row of data is being processed.void
itemsFinished(org.pentaho.reporting.engine.classic.core.event.ReportEvent event)
Receives notification that a group of item bands has been completed.void
itemsStarted(org.pentaho.reporting.engine.classic.core.event.ReportEvent event)
Receives notification that a group of item bands is about to be processed.void
pageFinished(org.pentaho.reporting.engine.classic.core.event.ReportEvent event)
Receives notification that a page is completed.void
pageStarted(org.pentaho.reporting.engine.classic.core.event.ReportEvent event)
Receives notification that a new page is being started.void
reportInitialized(org.pentaho.reporting.engine.classic.core.event.ReportEvent event)
Receives notification that report generation initializes the current run.void
reportStarted(org.pentaho.reporting.engine.classic.core.event.ReportEvent event)
Receives notification that the report has started.void
setCollectDetails(boolean collectDetails)
void
setDependencyLevel(int dependencyLevel)
void
setGroup(int index, String field)
Defines the field in the field-list at the given index.void
setGroup(String[] fields)
Defines all groups as array.void
setIndexSeparator(String indexSeparator)
void
setTitleField(String titleField)
void
setTitleFormula(String titleFormula)
-
Methods inherited from class org.pentaho.reporting.engine.classic.core.function.AbstractFunction
reportDone, reportFinished, summaryRowSelection
-
Methods inherited from class org.pentaho.reporting.engine.classic.core.function.AbstractExpression
getDataRow, getName, getReportConfiguration, getResourceBundleFactory, getRuntime, isActive, isPreserve, setActive, setName, setPreserve, setRuntime
-
-
-
-
Method Detail
-
setDependencyLevel
public void setDependencyLevel(int dependencyLevel)
- Specified by:
setDependencyLevel
in interfaceorg.pentaho.reporting.engine.classic.core.function.Expression
- Overrides:
setDependencyLevel
in classorg.pentaho.reporting.engine.classic.core.function.AbstractExpression
-
getDependencyLevel
public int getDependencyLevel()
Returns the dependency level for the expression (controls evaluation order for expressions and functions).- Specified by:
getDependencyLevel
in interfaceorg.pentaho.reporting.engine.classic.core.function.Expression
- Overrides:
getDependencyLevel
in classorg.pentaho.reporting.engine.classic.core.function.AbstractExpression
- Returns:
- the level.
-
getIndexSeparator
public String getIndexSeparator()
-
setIndexSeparator
public void setIndexSeparator(String indexSeparator)
-
getTitleFormula
public String getTitleFormula()
-
setTitleFormula
public void setTitleFormula(String titleFormula)
-
getTitleField
public String getTitleField()
-
setTitleField
public void setTitleField(String titleField)
-
isCollectDetails
public boolean isCollectDetails()
-
setCollectDetails
public void setCollectDetails(boolean collectDetails)
-
setGroup
public void setGroup(int index, String field)
Defines the field in the field-list at the given index.- Parameters:
index
- the position in the list, where the field should be defined.field
- the name of the field.
-
getGroup
public String getGroup(int index)
Returns the defined field at the given index-position.- Parameters:
index
- the position of the field name that should be queried.- Returns:
- the field name at the given position.
-
getGroupCount
public int getGroupCount()
Returns the number of groups defined in this expression.- Returns:
- the number of groups.
-
getGroup
public String[] getGroup()
Returns all defined groups as array of strings.- Returns:
- all the groups.
-
setGroup
public void setGroup(String[] fields)
Defines all groups as array. This completely replaces any previously defined groups.- Parameters:
fields
- the new list of groups.
-
reportInitialized
public void reportInitialized(org.pentaho.reporting.engine.classic.core.event.ReportEvent event)
Receives notification that report generation initializes the current run.The event carries a ReportState.Started state. Use this to initialize the report.
- Specified by:
reportInitialized
in interfaceorg.pentaho.reporting.engine.classic.core.event.ReportListener
- Overrides:
reportInitialized
in classorg.pentaho.reporting.engine.classic.core.function.AbstractFunction
- Parameters:
event
- The event.
-
reportStarted
public void reportStarted(org.pentaho.reporting.engine.classic.core.event.ReportEvent event)
Receives notification that the report has started.- Specified by:
reportStarted
in interfaceorg.pentaho.reporting.engine.classic.core.event.ReportListener
- Overrides:
reportStarted
in classorg.pentaho.reporting.engine.classic.core.function.AbstractFunction
- Parameters:
event
- the event.
-
groupStarted
public void groupStarted(org.pentaho.reporting.engine.classic.core.event.ReportEvent event)
- Specified by:
groupStarted
in interfaceorg.pentaho.reporting.engine.classic.core.event.ReportListener
- Overrides:
groupStarted
in classorg.pentaho.reporting.engine.classic.core.function.AbstractFunction
-
itemsStarted
public void itemsStarted(org.pentaho.reporting.engine.classic.core.event.ReportEvent event)
Receives notification that a group of item bands is about to be processed.The next events will be itemsAdvanced events until the itemsFinished event is raised.
- Specified by:
itemsStarted
in interfaceorg.pentaho.reporting.engine.classic.core.event.ReportListener
- Overrides:
itemsStarted
in classorg.pentaho.reporting.engine.classic.core.function.AbstractFunction
- Parameters:
event
- The event.
-
itemsAdvanced
public void itemsAdvanced(org.pentaho.reporting.engine.classic.core.event.ReportEvent event)
Receives notification that a row of data is being processed.- Specified by:
itemsAdvanced
in interfaceorg.pentaho.reporting.engine.classic.core.event.ReportListener
- Overrides:
itemsAdvanced
in classorg.pentaho.reporting.engine.classic.core.function.AbstractFunction
- Parameters:
event
- the event.
-
itemsFinished
public void itemsFinished(org.pentaho.reporting.engine.classic.core.event.ReportEvent event)
Receives notification that a group of item bands has been completed.The itemBand is finished, the report starts to close open groups.
- Specified by:
itemsFinished
in interfaceorg.pentaho.reporting.engine.classic.core.event.ReportListener
- Overrides:
itemsFinished
in classorg.pentaho.reporting.engine.classic.core.function.AbstractFunction
- Parameters:
event
- The event.
-
groupFinished
public void groupFinished(org.pentaho.reporting.engine.classic.core.event.ReportEvent event)
Receives notification that a group has finished.- Specified by:
groupFinished
in interfaceorg.pentaho.reporting.engine.classic.core.event.ReportListener
- Overrides:
groupFinished
in classorg.pentaho.reporting.engine.classic.core.function.AbstractFunction
- Parameters:
event
- the event.
-
pageStarted
public void pageStarted(org.pentaho.reporting.engine.classic.core.event.ReportEvent event)
Receives notification that a new page is being started.- Specified by:
pageStarted
in interfaceorg.pentaho.reporting.engine.classic.core.event.PageEventListener
- Parameters:
event
- The event.
-
pageFinished
public void pageFinished(org.pentaho.reporting.engine.classic.core.event.ReportEvent event)
Receives notification that a page is completed.- Specified by:
pageFinished
in interfaceorg.pentaho.reporting.engine.classic.core.event.PageEventListener
- Parameters:
event
- The event.
-
getValue
public Object getValue()
Return the current expression value. The value depends (obviously) on the expression implementation.- Specified by:
getValue
in interfaceorg.pentaho.reporting.engine.classic.core.function.Expression
- Returns:
- the value of the function.
-
getModel
public org.pentaho.reporting.engine.classic.core.util.TypedTableModel getModel()
-
isDeepTraversing
public boolean isDeepTraversing()
Checks whether this expression is a deep-traversing expression. Deep-traversing expressions receive events from all sub-reports. This returns false by default, as ordinary expressions have no need to be deep-traversing.- Specified by:
isDeepTraversing
in interfaceorg.pentaho.reporting.engine.classic.core.function.Expression
- Overrides:
isDeepTraversing
in classorg.pentaho.reporting.engine.classic.core.function.AbstractExpression
- Returns:
- false.
-
clone
public Object clone() throws CloneNotSupportedException
Clones the expression. The expression should be reinitialized after the cloning.Expressions maintain no state, cloning is done at the beginning of the report processing to disconnect the expression from any other object space.
- Specified by:
clone
in interfaceorg.pentaho.reporting.engine.classic.core.function.Expression
- Overrides:
clone
in classorg.pentaho.reporting.engine.classic.core.function.AbstractExpression
- Returns:
- a clone of this expression.
- Throws:
CloneNotSupportedException
- this should never happen.
-
getInstance
public org.pentaho.reporting.engine.classic.core.function.Expression getInstance()
Return a completly separated copy of this function. The copy does no longer share any changeable objects with the original function.- Specified by:
getInstance
in interfaceorg.pentaho.reporting.engine.classic.core.function.Expression
- Overrides:
getInstance
in classorg.pentaho.reporting.engine.classic.core.function.AbstractExpression
- Returns:
- a copy of this function.
-
-