org.pentaho.reporting.engine.classic.core.function
Class EventMonitorFunction

java.lang.Object
  extended by org.pentaho.reporting.engine.classic.core.function.AbstractExpression
      extended by org.pentaho.reporting.engine.classic.core.function.AbstractFunction
          extended by 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
EventMonitorFunction()
          Creates a new function.
EventMonitorFunction(String name)
          Creates a new function.
 
Method Summary
 Object getValue()
          Returns null 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.AbstractExpression
clone, getDataRow, getDependencyLevel, getInstance, getName, getReportConfiguration, getResourceBundleFactory, getRuntime, isActive, isPreserve, setActive, setDependencyLevel, setName, setPreserve, setRuntime
 
Methods inherited from class java.lang.Object
equals, 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 interface ReportListener
Overrides:
reportStarted in class AbstractFunction
Parameters:
event - the event.

reportFinished

public void reportFinished(ReportEvent event)
Receives notification that the report has finished.

Specified by:
reportFinished in interface ReportListener
Overrides:
reportFinished in class AbstractFunction
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 interface ReportListener
Overrides:
reportDone in class AbstractFunction
Parameters:
event - The event.

pageStarted

public void pageStarted(ReportEvent event)
Receives notification that a page has started.

Specified by:
pageStarted in interface PageEventListener
Parameters:
event - the event.

pageFinished

public void pageFinished(ReportEvent event)
Receives notification that a page has ended.

Specified by:
pageFinished in interface PageEventListener
Parameters:
event - the event.

groupStarted

public void groupStarted(ReportEvent event)
Receives notification that a group has started.

Specified by:
groupStarted in interface ReportListener
Overrides:
groupStarted in class AbstractFunction
Parameters:
event - the event.

groupFinished

public void groupFinished(ReportEvent event)
Receives notification that a group has finished.

Specified by:
groupFinished in interface ReportListener
Overrides:
groupFinished in class AbstractFunction
Parameters:
event - the event.

itemsAdvanced

public void itemsAdvanced(ReportEvent event)
Receives notification that a row of data is being processed.

Specified by:
itemsAdvanced in interface ReportListener
Overrides:
itemsAdvanced in class AbstractFunction
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 interface ReportListener
Overrides:
itemsStarted in class AbstractFunction
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 interface ReportListener
Overrides:
itemsFinished in class AbstractFunction
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 interface ReportListener
Overrides:
reportInitialized in class AbstractFunction
Parameters:
event - The event.

getValue

public Object getValue()
Returns null since this function is for generating log messages only.

Specified by:
getValue in interface Expression
Returns:
the value of the function (null).

isDeepTraversing

public boolean isDeepTraversing()
Returns whether this expression will receive events from subreports.

Specified by:
isDeepTraversing in interface Expression
Overrides:
isDeepTraversing in class AbstractExpression
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.