net.objectlab.qalab.parser
Class CheckstyleOrPMDBaseMerge

java.lang.Object
  extended by org.xml.sax.helpers.DefaultHandler
      extended by net.objectlab.qalab.parser.BaseStatMerge
          extended by net.objectlab.qalab.parser.CheckstyleOrPMDBaseMerge
All Implemented Interfaces:
StatMerger, org.xml.sax.ContentHandler, org.xml.sax.DTDHandler, org.xml.sax.EntityResolver, org.xml.sax.ErrorHandler
Direct Known Subclasses:
CheckstyleStatMerge, FindBugsStatMerge, PMDStatMerge

public abstract class CheckstyleOrPMDBaseMerge
extends BaseStatMerge

This abstract class defines most common code between the handling of Checkstyle and PMD XML.

Version:
$Revision: 187 $
Author:
Benoit Xhenseval

Constructor Summary
CheckstyleOrPMDBaseMerge()
           
 
Method Summary
 void endElement(java.lang.String ignoreNamespaceURI, java.lang.String ignoreSimplename, java.lang.String qualifiedname)
          At the end of an element, check if it is a file one and add the results found.
protected abstract  java.lang.String getFileNameAttribute()
           
protected abstract  java.lang.String getFileTag()
           
protected abstract  java.lang.String getViolationTag()
           
protected  void setFileName(org.xml.sax.Attributes att)
          set the file name from the attributes from Checkstyle/Findbugs XML.
 void startElement(java.lang.String ignoreNamespaceURI, java.lang.String localname, java.lang.String qualifiedname, org.xml.sax.Attributes attrs)
          At the start of a new element, capture the filename and if the element is a result one, create a SingleStat to store for the given type.
 
Methods inherited from class net.objectlab.qalab.parser.BaseStatMerge
addFileStatistics, addNewResults, addTotalStatistics, getFileCount, getFileStatistics, getMergerTimeStamp, getSrcDir, getTaskLogger, getTotalStatistics, incrementFileCount, isQuiet, mergeStats, preProcessSource, resetFileStatistics, setCurrentFile, setMergerTimeStamp, setQuiet, setSrcDir, setTaskLogger, setTotalStatistics
 
Methods inherited from class org.xml.sax.helpers.DefaultHandler
characters, endDocument, endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, startDocument, startPrefixMapping, unparsedEntityDecl, warning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface net.objectlab.qalab.parser.StatMerger
getType
 

Constructor Detail

CheckstyleOrPMDBaseMerge

public CheckstyleOrPMDBaseMerge()
Method Detail

startElement

public final void startElement(java.lang.String ignoreNamespaceURI,
                               java.lang.String localname,
                               java.lang.String qualifiedname,
                               org.xml.sax.Attributes attrs)
                        throws org.xml.sax.SAXException
At the start of a new element, capture the filename and if the element is a result one, create a SingleStat to store for the given type.

Specified by:
startElement in interface org.xml.sax.ContentHandler
Overrides:
startElement in class org.xml.sax.helpers.DefaultHandler
Parameters:
ignoreNamespaceURI - ignore (present for interface implementation).
localname - name of the current element.
qualifiedname - element name.
attrs - the XML attribute of the current element.
Throws:
org.xml.sax.SAXException - any SAX issue

endElement

public final void endElement(java.lang.String ignoreNamespaceURI,
                             java.lang.String ignoreSimplename,
                             java.lang.String qualifiedname)
                      throws org.xml.sax.SAXException
At the end of an element, check if it is a file one and add the results found.

Specified by:
endElement in interface org.xml.sax.ContentHandler
Overrides:
endElement in class org.xml.sax.helpers.DefaultHandler
Parameters:
ignoreNamespaceURI - ignore (present for interface implementation).
ignoreSimplename - ignore (present for interface implementation).
qualifiedname - the name of the element.
Throws:
org.xml.sax.SAXException - any SAX issue

getFileTag

protected abstract java.lang.String getFileTag()
Returns:
the tag for "file"

getFileNameAttribute

protected abstract java.lang.String getFileNameAttribute()
Returns:
the attribute name for fileName

getViolationTag

protected abstract java.lang.String getViolationTag()
Returns:
tag for a violation/error

setFileName

protected void setFileName(org.xml.sax.Attributes att)
set the file name from the attributes from Checkstyle/Findbugs XML.

Parameters:
att - xml attributes