Class EventMonitorFunction
- 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.EventMonitorFunction
-
- All Implemented Interfaces:
Serializable
,Cloneable
,EventListener
,PageEventListener
,ReportListener
,Expression
,Function
public class EventMonitorFunction extends AbstractFunction implements PageEventListener
A function that logs each event that it receives. This function can be used for debugging purposes.- Author:
- Thomas Morgner
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description EventMonitorFunction()
Creates a new function.EventMonitorFunction(String name)
Creates a new function.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Object
getValue()
Returnsnull
since this function is for generating log messages only.void
groupFinished(ReportEvent event)
Receives notification that a group has finished.void
groupStarted(ReportEvent event)
Receives notification that a group has started.boolean
isDeepTraversing()
Returns whether this expression will receive events from subreports.void
itemsAdvanced(ReportEvent event)
Receives notification that a row of data is being processed.void
itemsFinished(ReportEvent event)
Receives notification that a group of item bands has been completed.void
itemsStarted(ReportEvent event)
Receives notification that a group of item bands is about to be processed.void
pageFinished(ReportEvent event)
Receives notification that a page has ended.void
pageStarted(ReportEvent event)
Receives notification that a page has started.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)
Receives notification that the report has finished.void
reportInitialized(ReportEvent event)
Receives notification that report generation initializes the current run.void
reportStarted(ReportEvent event)
Receives notification that the report has started.void
setDeepTraversing(boolean deepTraversing)
Defines, whether this expression will receive events from subreports.-
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, getDependencyLevel, getInstance, getName, getReportConfiguration, getResourceBundleFactory, getRuntime, isActive, 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, getDependencyLevel, getInstance, getName, getReportConfiguration, getResourceBundleFactory, getRuntime, isActive, isPreserve, setDependencyLevel, setName, setRuntime
-
-
-
-
Constructor Detail
-
EventMonitorFunction
public EventMonitorFunction()
Creates a new function.
-
EventMonitorFunction
public EventMonitorFunction(String name)
Creates a new function.- Parameters:
name
- the name of the function
-
-
Method Detail
-
reportStarted
public void reportStarted(ReportEvent event)
Receives notification that the report has started.- Specified by:
reportStarted
in interfaceReportListener
- Overrides:
reportStarted
in classAbstractFunction
- Parameters:
event
- the event.
-
reportFinished
public void reportFinished(ReportEvent event)
Receives notification that the report has finished.- Specified by:
reportFinished
in interfaceReportListener
- Overrides:
reportFinished
in classAbstractFunction
- Parameters:
event
- the event.
-
reportDone
public void reportDone(ReportEvent event)
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.
-
pageStarted
public void pageStarted(ReportEvent event)
Receives notification that a page has started.- Specified by:
pageStarted
in interfacePageEventListener
- Parameters:
event
- the event.
-
pageFinished
public void pageFinished(ReportEvent event)
Receives notification that a page has ended.- Specified by:
pageFinished
in interfacePageEventListener
- Parameters:
event
- the event.
-
groupStarted
public void groupStarted(ReportEvent event)
Receives notification that a group has started.- Specified by:
groupStarted
in interfaceReportListener
- Overrides:
groupStarted
in classAbstractFunction
- Parameters:
event
- the event.
-
groupFinished
public void groupFinished(ReportEvent event)
Receives notification that a group has finished.- Specified by:
groupFinished
in interfaceReportListener
- Overrides:
groupFinished
in classAbstractFunction
- Parameters:
event
- the event.
-
itemsAdvanced
public void itemsAdvanced(ReportEvent event)
Receives notification that a row of data is being processed.- Specified by:
itemsAdvanced
in interfaceReportListener
- Overrides:
itemsAdvanced
in classAbstractFunction
- Parameters:
event
- the event.
-
itemsStarted
public void itemsStarted(ReportEvent event)
Receives notification that a group of item bands is about to be processed.- Specified by:
itemsStarted
in interfaceReportListener
- Overrides:
itemsStarted
in classAbstractFunction
- Parameters:
event
- the event.
-
itemsFinished
public void itemsFinished(ReportEvent event)
Receives notification that a group of item bands has been completed.- Specified by:
itemsFinished
in interfaceReportListener
- Overrides:
itemsFinished
in classAbstractFunction
- Parameters:
event
- the event.
-
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.
-
getValue
public Object getValue()
Returnsnull
since this function is for generating log messages only.- Specified by:
getValue
in interfaceExpression
- Returns:
- the value of the function (
null
).
-
isDeepTraversing
public boolean isDeepTraversing()
Returns whether this expression will receive events from subreports.- Specified by:
isDeepTraversing
in interfaceExpression
- Overrides:
isDeepTraversing
in classAbstractExpression
- Returns:
- true, if the function is deep-traversing, false otherwise.
-
setDeepTraversing
public void setDeepTraversing(boolean deepTraversing)
Defines, whether this expression will receive events from subreports.- Parameters:
deepTraversing
- true, if the function is deep-traversing, false otherwise.
-
-