org.jacoco.report.xml
Class NodeWithCoverage

java.lang.Object
  extended by org.jacoco.report.xml.XMLElement
      extended by org.jacoco.report.xml.NodeWithCoverage
All Implemented Interfaces:
IReportVisitor
Direct Known Subclasses:
ClassNode, GroupNode, MethodNode, PackageNode

public abstract class NodeWithCoverage
extends XMLElement
implements IReportVisitor

Base class for implementing XML Elements that contain coverage elements

Version:
$Revision: $
Author:
Brock Janiczak

Field Summary
 
Fields inherited from class org.jacoco.report.xml.XMLElement
writer
 
Constructor Summary
NodeWithCoverage(XMLElement parent, String elementName, ICoverageNode node)
          Creates a new Coverage node under the supplied parent
 
Method Summary
protected  ICoverageNode.CounterEntity[] getCounterEntities()
          Retrieves the list of counters supported by this element
 void visitEnd(ISourceFileLocator sourceFileLocator)
          Called at the very end, when all child node have been processed and the counters for this node are properly populated.
 
Methods inherited from class org.jacoco.report.xml.XMLElement
addChildElement, attr, beginOpenTag, close, element, text
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.jacoco.report.IReportVisitor
visitChild
 

Constructor Detail

NodeWithCoverage

public NodeWithCoverage(XMLElement parent,
                        String elementName,
                        ICoverageNode node)
                 throws IOException
Creates a new Coverage node under the supplied parent

Parameters:
parent - Parent element
elementName - Name of this element
node - Coverage node
Throws:
IOException - IO Error creating this element
Method Detail

visitEnd

public final void visitEnd(ISourceFileLocator sourceFileLocator)
                    throws IOException
Description copied from interface: IReportVisitor
Called at the very end, when all child node have been processed and the counters for this node are properly populated.

Specified by:
visitEnd in interface IReportVisitor
Parameters:
sourceFileLocator - source file locator valid for this node
Throws:
IOException - in case of IO problems with the report writer

getCounterEntities

protected ICoverageNode.CounterEntity[] getCounterEntities()
Retrieves the list of counters supported by this element

Returns:
Counters supported by this element