com.nokia.ant.taskdefs
Class CoverageRecorderEntry

java.lang.Object
  extended by com.nokia.ant.taskdefs.CoverageRecorderEntry
All Implemented Interfaces:
java.util.EventListener, org.apache.tools.ant.BuildListener, org.apache.tools.ant.BuildLogger, org.apache.tools.ant.SubBuildListener

public class CoverageRecorderEntry
extends java.lang.Object
implements org.apache.tools.ant.BuildLogger, org.apache.tools.ant.SubBuildListener

This is a class that represents a XML recorder. This is the listener to the build process.


Nested Class Summary
protected static class CoverageRecorderEntry.TimedElement
          Utility class representing the time an element started.
 
Constructor Summary
protected CoverageRecorderEntry(java.lang.String name, java.lang.String recordTaskName)
           
 
Method Summary
 void buildFinished(org.apache.tools.ant.BuildEvent event)
          .
 void buildStarted(org.apache.tools.ant.BuildEvent event)
          .
 void cleanup()
           
protected static javax.xml.parsers.DocumentBuilder getDocumentBuilder()
          Returns a default DocumentBuilder instance or throws an ExceptionInInitializerError if it can't be created.
 java.lang.String getFilename()
           
protected  java.util.Stack getStack()
          Returns the stack of timed elements for the current thread.
protected  CoverageRecorderEntry.TimedElement getTaskElement(org.apache.tools.ant.Task task)
          Get the TimedElement associated with a task.
 void messageLogged(org.apache.tools.ant.BuildEvent event)
          .
 void setEmacsMode(boolean emacsMode)
          .
 void setErrorPrintStream(java.io.PrintStream err)
          .
 void setMessageOutputLevel(int level)
          .
 void setOutputPrintStream(java.io.PrintStream output)
          .
 void setProject(org.apache.tools.ant.Project project)
          Set the project associated with this recorder entry.
 void setRecordState(java.lang.Boolean state)
          Turns off or on this recorder.
 void subBuildFinished(org.apache.tools.ant.BuildEvent event)
          Cleans up any resources held by this recorder entry at the end of a subbuild if it has been created for the subbuild's project instance.
 void subBuildStarted(org.apache.tools.ant.BuildEvent event)
          Empty implementation to satisfy the BuildListener interface.
 void targetFinished(org.apache.tools.ant.BuildEvent event)
          .
 void targetStarted(org.apache.tools.ant.BuildEvent event)
          .
 void taskFinished(org.apache.tools.ant.BuildEvent event)
          .
 void taskStarted(org.apache.tools.ant.BuildEvent event)
          .
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CoverageRecorderEntry

protected CoverageRecorderEntry(java.lang.String name,
                                java.lang.String recordTaskName)
Parameters:
name - The name of this recorder (used as the filename).
Method Detail

getDocumentBuilder

protected static javax.xml.parsers.DocumentBuilder getDocumentBuilder()
Returns a default DocumentBuilder instance or throws an ExceptionInInitializerError if it can't be created.

Returns:
a default DocumentBuilder instance.

getStack

protected java.util.Stack getStack()
Returns the stack of timed elements for the current thread.

Returns:
the stack of timed elements for the current thread

getFilename

public java.lang.String getFilename()
Returns:
the name of the file the output is sent to.

setRecordState

public void setRecordState(java.lang.Boolean state)
Turns off or on this recorder.

Parameters:
state - true for on, false for off, null for no change.

buildStarted

public void buildStarted(org.apache.tools.ant.BuildEvent event)
.

Specified by:
buildStarted in interface org.apache.tools.ant.BuildListener

buildFinished

public void buildFinished(org.apache.tools.ant.BuildEvent event)
.

Specified by:
buildFinished in interface org.apache.tools.ant.BuildListener

subBuildFinished

public void subBuildFinished(org.apache.tools.ant.BuildEvent event)
Cleans up any resources held by this recorder entry at the end of a subbuild if it has been created for the subbuild's project instance.

Specified by:
subBuildFinished in interface org.apache.tools.ant.SubBuildListener
Parameters:
event - the buildFinished event
Since:
Ant 1.6.2

subBuildStarted

public void subBuildStarted(org.apache.tools.ant.BuildEvent event)
Empty implementation to satisfy the BuildListener interface.

Specified by:
subBuildStarted in interface org.apache.tools.ant.SubBuildListener
Parameters:
event - the buildStarted event
Since:
Ant 1.6.2

targetStarted

public void targetStarted(org.apache.tools.ant.BuildEvent event)
.

Specified by:
targetStarted in interface org.apache.tools.ant.BuildListener

targetFinished

public void targetFinished(org.apache.tools.ant.BuildEvent event)
.

Specified by:
targetFinished in interface org.apache.tools.ant.BuildListener

taskStarted

public void taskStarted(org.apache.tools.ant.BuildEvent event)
.

Specified by:
taskStarted in interface org.apache.tools.ant.BuildListener

taskFinished

public void taskFinished(org.apache.tools.ant.BuildEvent event)
.

Specified by:
taskFinished in interface org.apache.tools.ant.BuildListener

getTaskElement

protected CoverageRecorderEntry.TimedElement getTaskElement(org.apache.tools.ant.Task task)
Get the TimedElement associated with a task. Where the task is not found directly, search for unknown elements which may be hiding the real task


messageLogged

public void messageLogged(org.apache.tools.ant.BuildEvent event)
.

Specified by:
messageLogged in interface org.apache.tools.ant.BuildListener

setMessageOutputLevel

public void setMessageOutputLevel(int level)
.

Specified by:
setMessageOutputLevel in interface org.apache.tools.ant.BuildLogger

setOutputPrintStream

public void setOutputPrintStream(java.io.PrintStream output)
.

Specified by:
setOutputPrintStream in interface org.apache.tools.ant.BuildLogger

setEmacsMode

public void setEmacsMode(boolean emacsMode)
.

Specified by:
setEmacsMode in interface org.apache.tools.ant.BuildLogger

setErrorPrintStream

public void setErrorPrintStream(java.io.PrintStream err)
.

Specified by:
setErrorPrintStream in interface org.apache.tools.ant.BuildLogger

setProject

public void setProject(org.apache.tools.ant.Project project)
Set the project associated with this recorder entry.

Parameters:
project - the project instance
Since:
1.6.2

cleanup

public void cleanup()
Since:
1.6.2