net.objectlab.qalab.parser
Class BuildStatForChartParser

java.lang.Object
  extended by org.xml.sax.helpers.DefaultHandler
      extended by net.objectlab.qalab.parser.BuildStatForChartParser
All Implemented Interfaces:
org.xml.sax.ContentHandler, org.xml.sax.DTDHandler, org.xml.sax.EntityResolver, org.xml.sax.ErrorHandler

public class BuildStatForChartParser
extends org.xml.sax.helpers.DefaultHandler

This is the parser for generating the charts from qalab.xml. Created by IntelliJ IDEA. User: xhensevalb Date: 09-Feb-2004 Time: 17:14:25

Version:
$Revision: 253 $

Constructor Summary
BuildStatForChartParser(TaskLogger logger)
          constructor, accepts the logger.
 
Method Summary
 void endElement(java.lang.String ignoreNamespaceURI, java.lang.String localName, java.lang.String qualifiedname)
          Called when a closing element tag is encountered, it generates the chart each time it moves from a file or summary.
 void error(org.xml.sax.SAXParseException ex)
          Error.
 void fatalError(org.xml.sax.SAXParseException ex)
          Fatal error.
 int getChartHeight()
           
 int getChartWidth()
           
 java.lang.String getFilePrefix()
           
 int getMovingAverage()
           
 java.lang.String getToDir()
           
 java.lang.String getXAxisSummaryTitle()
           
 java.lang.String getXAxisTitle()
           
 java.lang.String getYAxisSummaryTitle()
           
 java.lang.String getYAxisTitle()
           
 boolean isQuiet()
           
 boolean isSummaryOnly()
           
 void setAcceptedStyle(java.lang.String acceptedStyleStr)
          set the accepted styles for charts, each type will be a line/series on the chart.
 void setChartHeight(int height)
           
 void setChartWidth(int width)
           
 void setFilePrefix(java.lang.String filePrefix)
           
 void setMovingAverage(int average)
           
 void setQuiet(boolean noLog)
           
 void setSummaryOnly(boolean summary)
           
 void setSummaryStyle(java.lang.String acceptedStyleStr)
          set the accepted styles for SUMMARY charts, each type will be a line/series on the chart.
 void setToDir(java.lang.String outputDirectory)
           
 void setXAxisSummaryTitle(java.lang.String axisSummaryTitle)
           
 void setXAxisTitle(java.lang.String axisTitle)
           
 void setYAxisSummaryTitle(java.lang.String axisSummaryTitle)
           
 void setYAxisTitle(java.lang.String axisTitle)
           
 void startElement(java.lang.String ignoreNamespaceURI, java.lang.String localname, java.lang.String qualifiedname, org.xml.sax.Attributes attrs)
          Start element, called when each new tag is encountered.
 void warning(org.xml.sax.SAXParseException ex)
          Warning.
 
Methods inherited from class org.xml.sax.helpers.DefaultHandler
characters, endDocument, endPrefixMapping, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, startDocument, startPrefixMapping, unparsedEntityDecl
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BuildStatForChartParser

public BuildStatForChartParser(TaskLogger logger)
constructor, accepts the logger.

Parameters:
logger - the looger for this task, will vary if ant/maven/other.
Method Detail

setAcceptedStyle

public final void setAcceptedStyle(java.lang.String acceptedStyleStr)
set the accepted styles for charts, each type will be a line/series on the chart. Accepted as a comma separated string, eg checkstyle,pmd for both PMD and Checkstyle.

Parameters:
acceptedStyleStr - a comma separated string with styles.

setSummaryStyle

public final void setSummaryStyle(java.lang.String acceptedStyleStr)
set the accepted styles for SUMMARY charts, each type will be a line/series on the chart. Accepted as a comma separated string, eg checkstyle,pmd for both PMD and Checkstyle.

Parameters:
acceptedStyleStr - a comma separated string with styles.

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
Start element, called when each new tag is encountered.

Specified by:
startElement in interface org.xml.sax.ContentHandler
Overrides:
startElement in class org.xml.sax.helpers.DefaultHandler
Parameters:
ignoreUri - ignore, this is due to sax interface.
local - local name of the tag.
ignoreRaw - ignore, this is due to sax interface.
attrs - the element attributes.
Throws:
org.xml.sax.SAXException - any SAX parser exception.

warning

public final void warning(org.xml.sax.SAXParseException ex)
                   throws org.xml.sax.SAXException
Warning.

Specified by:
warning in interface org.xml.sax.ErrorHandler
Overrides:
warning in class org.xml.sax.helpers.DefaultHandler
Parameters:
ex - the SAX Parser Exception.
Throws:
org.xml.sax.SAXException - any SAX Parser Exception.

error

public final void error(org.xml.sax.SAXParseException ex)
                 throws org.xml.sax.SAXException
Error.

Specified by:
error in interface org.xml.sax.ErrorHandler
Overrides:
error in class org.xml.sax.helpers.DefaultHandler
Parameters:
ex - the SAX Parser Exception.
Throws:
org.xml.sax.SAXException - any SAX Parser Exception.

fatalError

public final void fatalError(org.xml.sax.SAXParseException ex)
                      throws org.xml.sax.SAXException
Fatal error.

Specified by:
fatalError in interface org.xml.sax.ErrorHandler
Overrides:
fatalError in class org.xml.sax.helpers.DefaultHandler
Parameters:
ex - the SAX Parser Exception.
Throws:
org.xml.sax.SAXException - any SAX Parser Exception.

endElement

public final void endElement(java.lang.String ignoreNamespaceURI,
                             java.lang.String localName,
                             java.lang.String qualifiedname)
                      throws org.xml.sax.SAXException
Called when a closing element tag is encountered, it generates the chart each time it moves from a file or summary.

Specified by:
endElement in interface org.xml.sax.ContentHandler
Overrides:
endElement in class org.xml.sax.helpers.DefaultHandler
Parameters:
ignoreUri - ignore, this is due to sax interface.
localName - local name of the tag.
ignoreQName - ignore, this is due to sax interface.
Throws:
org.xml.sax.SAXException - any SAX exceptions.

getYAxisSummaryTitle

public java.lang.String getYAxisSummaryTitle()
Returns:
Returns the yAxisSummaryTitle.

setYAxisSummaryTitle

public void setYAxisSummaryTitle(java.lang.String axisSummaryTitle)
Parameters:
axisSummaryTitle - The yAxisSummaryTitle to set.

getChartWidth

public final int getChartWidth()
Returns:
chart width in pixels.

setChartWidth

public final void setChartWidth(int width)
Parameters:
width - in pixels.

getChartHeight

public final int getChartHeight()
Returns:
chart height in pixels.

setChartHeight

public final void setChartHeight(int height)
Parameters:
height - in pixels.

getToDir

public final java.lang.String getToDir()
Returns:
output directory.

setToDir

public final void setToDir(java.lang.String outputDirectory)
Parameters:
outputDirectory - output directory.

getMovingAverage

public final int getMovingAverage()
Returns:
number of point to take into account for moving average.

setMovingAverage

public final void setMovingAverage(int average)
Parameters:
average - number of points to take into account in moving average, no moving average if <= 0.

getXAxisSummaryTitle

public java.lang.String getXAxisSummaryTitle()
Returns:
Returns the xAxisSummaryTitle.

setXAxisSummaryTitle

public void setXAxisSummaryTitle(java.lang.String axisSummaryTitle)
Parameters:
axisSummaryTitle - The xAxisSummaryTitle to set.

isSummaryOnly

public final boolean isSummaryOnly()
Returns:
true if only summary chart required.

setSummaryOnly

public final void setSummaryOnly(boolean summary)
Parameters:
summary - true if we require only summary chart.

isQuiet

public final boolean isQuiet()
Returns:
true if no debug log required.

setQuiet

public final void setQuiet(boolean noLog)
Parameters:
noLog - true if no debug log required.

getFilePrefix

public java.lang.String getFilePrefix()
Returns:
Returns the filePrefix.

setFilePrefix

public void setFilePrefix(java.lang.String filePrefix)
Parameters:
filePrefix - The filePrefix to set.

getXAxisTitle

public java.lang.String getXAxisTitle()
Returns:
Returns the xAxisTitle.

setXAxisTitle

public void setXAxisTitle(java.lang.String axisTitle)
Parameters:
axisTitle - The xAxisTitle to set.

getYAxisTitle

public java.lang.String getYAxisTitle()
Returns:
Returns the yAxisTitle.

setYAxisTitle

public void setYAxisTitle(java.lang.String axisTitle)
Parameters:
axisTitle - The yAxisTitle to set.