Class AbstractElementFormatFunction
- java.lang.Object
-
- org.pentaho.reporting.engine.classic.core.function.AbstractExpression
-
- org.pentaho.reporting.engine.classic.core.function.AbstractFunction
-
- org.pentaho.reporting.engine.classic.core.function.AbstractElementFormatFunction
-
- All Implemented Interfaces:
Serializable
,Cloneable
,EventListener
,PageEventListener
,ReportListener
,Expression
,Function
,LayoutProcessorFunction
- Direct Known Subclasses:
AttributeExpressionsEvaluator
,CellFormatFunction
,CreateHyperLinksFunction
,ElementColorFunction
,ElementTrafficLightFunction
,ElementVisibilityFunction
,HideElementByNameFunction
,HideElementIfDataAvailableExpression
,HideNullValuesFunction
,MetaDataStyleEvaluator
,NegativeNumberPaintChangeFunction
,SheetNameFunction
,ShowElementByNameFunction
,ShowElementIfDataAvailableExpression
,StyleExpressionsEvaluator
,StyleResolvingEvaluator
,WizardItemHideFunction
public abstract class AbstractElementFormatFunction extends AbstractFunction implements PageEventListener, LayoutProcessorFunction
The AbstractElementFormatFunction provides a common base implementation for all functions that need to modify the report definition or the style of an report element or band during the report processing. The Expression retrieves the next root-level band that will be printed and uses this band as parameter for theprocessRootBand(org.pentaho.reporting.engine.classic.core.Section)
method.- Author:
- Thomas Morgner
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractElementFormatFunction()
Creates an unnamed function.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract boolean
evaluateElement(ReportElement e)
int
getDependencyLevel()
Returns the dependency level for the expression (controls evaluation order for expressions and functions).String
getElement()
Returns the element name.AbstractElementFormatFunction
getInstance()
Return a completly separated copy of this function.Object
getValue()
Format-Functions usually are not expected to return anything.void
groupFinished(ReportEvent event)
Processes the group footer of the current group.void
groupStarted(ReportEvent event)
Processes the group header of the current group.protected boolean
isExecutable()
void
itemsAdvanced(ReportEvent event)
Processes the ItemBand.void
itemsFinished(ReportEvent event)
Receives notification that a group of item bands has been completed.void
itemsStarted(ReportEvent event)
Processes the No-Data-Band.void
pageFinished(ReportEvent event)
Processes the page footer.void
pageStarted(ReportEvent event)
Processes the page header.protected boolean
processBand(Section b)
protected void
processFooterBands(ReportState state)
protected void
processGroupHeaders(Group group)
protected void
processHeaderBands(ReportState state)
protected void
processRootBand(Section b)
Evaluates all style expressions from all elements and updates the style-sheet if needed.protected void
recordCacheHit(ReportElement e)
protected void
recordCacheMiss(ReportElement e)
protected void
reportCachePerformance()
void
reportDone(ReportEvent event)
Receives notification that report generation has completed, the report footer was printed, no more output is done.void
reportFinished(ReportEvent event)
Processes the Report-Footer.void
reportInitialized(ReportEvent event)
Receives notification that report generation initializes the current run.void
reportStarted(ReportEvent event)
Processes the Report-Header.void
setElement(String name)
Sets the element name.-
Methods inherited from class org.pentaho.reporting.engine.classic.core.function.AbstractFunction
summaryRowSelection
-
Methods inherited from class org.pentaho.reporting.engine.classic.core.function.AbstractExpression
clone, getDataRow, getName, getReportConfiguration, getResourceBundleFactory, getRuntime, isActive, isDeepTraversing, isPreserve, setActive, setDependencyLevel, setName, setPreserve, setRuntime
-
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.pentaho.reporting.engine.classic.core.function.Expression
clone, getDataRow, getName, getReportConfiguration, getResourceBundleFactory, getRuntime, isActive, isDeepTraversing, isPreserve, setDependencyLevel, setName, setRuntime
-
Methods inherited from interface org.pentaho.reporting.engine.classic.core.event.ReportListener
summaryRowSelection
-
-
-
-
Constructor Detail
-
AbstractElementFormatFunction
protected AbstractElementFormatFunction()
Creates an unnamed function. Make sure the name of the function is set usingAbstractExpression.setName(java.lang.String)
before the function is added to the report's function collection.
-
-
Method Detail
-
setElement
public void setElement(String name)
Sets the element name. The name denotes an element or band within the root-band or the root-band itself. It is possible to define multiple elements with the same name to apply the modification to all of these elements.- Parameters:
name
- The element name.- See Also:
FunctionUtilities.findAllElements(org.pentaho.reporting .engine.classic.core.Band, String)
-
getElement
public String getElement()
Returns the element name.- Returns:
- The element name.
- See Also:
setElement(String)
-
reportInitialized
public void reportInitialized(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 interfaceReportListener
- Overrides:
reportInitialized
in classAbstractFunction
- Parameters:
event
- The event.
-
reportStarted
public void reportStarted(ReportEvent event)
Processes the Report-Header.- Specified by:
reportStarted
in interfaceReportListener
- Overrides:
reportStarted
in classAbstractFunction
- Parameters:
event
- the event.
-
groupStarted
public void groupStarted(ReportEvent event)
Processes the group header of the current group.- Specified by:
groupStarted
in interfaceReportListener
- Overrides:
groupStarted
in classAbstractFunction
- Parameters:
event
- the event.
-
itemsStarted
public void itemsStarted(ReportEvent event)
Processes the No-Data-Band.- Specified by:
itemsStarted
in interfaceReportListener
- Overrides:
itemsStarted
in classAbstractFunction
- Parameters:
event
- the report event.
-
itemsAdvanced
public void itemsAdvanced(ReportEvent event)
Processes the ItemBand.- Specified by:
itemsAdvanced
in interfaceReportListener
- Overrides:
itemsAdvanced
in classAbstractFunction
- Parameters:
event
- the event.
-
itemsFinished
public void itemsFinished(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 interfaceReportListener
- Overrides:
itemsFinished
in classAbstractFunction
- Parameters:
event
- The event.
-
groupFinished
public void groupFinished(ReportEvent event)
Processes the group footer of the current group.- Specified by:
groupFinished
in interfaceReportListener
- Overrides:
groupFinished
in classAbstractFunction
- Parameters:
event
- the event.
-
reportFinished
public void reportFinished(ReportEvent event)
Processes the Report-Footer.- Specified by:
reportFinished
in interfaceReportListener
- Overrides:
reportFinished
in classAbstractFunction
- Parameters:
event
- the event.
-
reportDone
public void reportDone(ReportEvent event)
Description copied from class:AbstractFunction
Receives notification that report generation has completed, the report footer was printed, no more output is done. This is a helper event to shut down the output service.- Specified by:
reportDone
in interfaceReportListener
- Overrides:
reportDone
in classAbstractFunction
- Parameters:
event
- The event.
-
reportCachePerformance
protected void reportCachePerformance()
-
processGroupHeaders
protected void processGroupHeaders(Group group)
-
pageFinished
public void pageFinished(ReportEvent event)
Processes the page footer.- Specified by:
pageFinished
in interfacePageEventListener
- Parameters:
event
- the event.
-
pageStarted
public void pageStarted(ReportEvent event)
Processes the page header.- Specified by:
pageStarted
in interfacePageEventListener
- Parameters:
event
- the event.
-
processFooterBands
protected void processFooterBands(ReportState state)
-
processHeaderBands
protected void processHeaderBands(ReportState state)
-
getValue
public Object getValue()
Format-Functions usually are not expected to return anything.- Specified by:
getValue
in interfaceExpression
- Returns:
- null, as format functions do not compute values.
-
isExecutable
protected boolean isExecutable()
-
processRootBand
protected final void processRootBand(Section b)
Evaluates all style expressions from all elements and updates the style-sheet if needed.- Parameters:
b
- the band.
-
recordCacheHit
protected void recordCacheHit(ReportElement e)
-
recordCacheMiss
protected void recordCacheMiss(ReportElement e)
-
evaluateElement
protected abstract boolean evaluateElement(ReportElement e)
-
processBand
protected final boolean processBand(Section b)
-
getDependencyLevel
public final int getDependencyLevel()
Description copied from class:AbstractExpression
Returns the dependency level for the expression (controls evaluation order for expressions and functions).- Specified by:
getDependencyLevel
in interfaceExpression
- Overrides:
getDependencyLevel
in classAbstractExpression
- Returns:
- the level.
-
getInstance
public AbstractElementFormatFunction getInstance()
Description copied from class:AbstractExpression
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 interfaceExpression
- Overrides:
getInstance
in classAbstractExpression
- Returns:
- a copy of this function.
-
-