|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jcoderz.phoenix.chart2d.Chart2DHandlerImpl
public class Chart2DHandlerImpl
Generated implementation for documents valid against
the chart2d dtd.
Also give the ability to collect input data from a certain set of
xml files.
The format is currently quite tailored to the needs of a cruise
control log file analysis. This might be opened up if further
requirements come up.
The format is given by the chart2d api. Look there
http://chart2d.sourceforge.net/ for details.
The special data collection is always started with a ! do
mark the special format.
For the AxisLabelText there are 2 additional
attributes:
count: The number of labels on the x-Axis.
If the dataset contains count * 2 or more
entries, n (= number of datasets / count) are put
together in one label.
max: The maximum number of datasets that are
allowed to be put together under one label. If the number of
available datasets is more than count * max the
elder datasets are discarded.
The element of AxisLabelText can contain a regular
expression, that is used to search for the logfiles used as
input datasets. The search is started recursive from the
given context path. Path separators must be given
as '/' characters if needed. The first group on the regular
expression is used as label for the dataset. An example could
be !.*log.*BUILD_([0-9]*)\.xml with would use the
number after the BUILD_ as labeltext.
The element of LegendLabelsTexts is the z-Axis.
If the element starts with a ! character the
rest must be a xpath expression returning a node set. Each
node of the nodeset will build a element (and label)
on the z-Axis. A valid expression could be:
!/cruisecontrol/findingsummary/servicelevelxml/service/@name.
The element of Data could also be an xpath
expression. The handler then iterates over this for each
file (dataset) and each value available for the z-Axis. The string
$z is replaced by the current z-Axis value before the xpath
expression is evaluated against the current file (dataset). The
handler takes care for the Set, Category,
Data element nesting. A valid expression could be:
!/cruisecontrol/findingsummary/servicelevelxml/service[@name = '$z']/@quality.
The expression should evaluate to a node that can be parsed as a
float using Float.parseFloat or to a ant timestring
matching the regular pattern
"(([0-9]+) minutes? )?([0-9]+) seconds?" the timestring
will be converted into the number of seconds. Other formats might be
added.
| Constructor Summary | |
|---|---|
Chart2DHandlerImpl(File dataRepository)
A new handler for cart2d files. |
|
| Method Summary | |
|---|---|
void |
endCategory()
Handles the closing of Category. |
void |
endChart2D()
A container element end event handling method. |
void |
endDataset()
Called at the end of a dataset. |
void |
endGraphChart2DProperties()
A container element end event handling method. |
void |
endGraphProperties()
A container element end event handling method. |
void |
endLBChart2D()
A container element end event handling method. |
void |
endLegendProperties()
A container element end event handling method. |
void |
endLLChart2D()
A container element end event handling method. |
void |
endMultiColorsProperties()
Handles the end of the MultiColorsProperties element. |
void |
endPieChart2D()
A container element end event handling method. |
void |
endSet()
A container element end event handling method. |
void |
handleAxisLabelText(String data,
Attributes meta)
A data element event handling method. |
void |
handleChart2DProperties(Attributes meta)
An empty element event handling method. |
void |
handleColorsCustom(String data,
Attributes meta)
A data element event handling method. |
void |
handleData(String data,
Attributes meta)
A data element event handling method. |
void |
handleGraphLabelsLinesStyle(Attributes meta)
An empty element event handling method. |
void |
handleGraphNumbersLinesStyle(Attributes meta)
An empty element event handling method. |
void |
handleLegendLabelsTexts(String data,
Attributes meta)
Handles the content of the LegentLablesTexts element. |
void |
handleObject2DProperties(Attributes meta)
An empty element event handling method. |
void |
handlePieChart2DProperties(Attributes meta)
A container element start event handling method. |
void |
handleWarningRegionProperties(Attributes meta)
An empty element event handling method. |
static void |
main(String[] args)
Commandline interface to this handler. |
void |
startCategory(Attributes meta)
Handles opening of Category a new ArrayList is created to collect inner Data elements. |
void |
startChart2D(Attributes meta)
A container element start event handling method. |
void |
startDataset(Attributes meta)
A container element start event handling method. |
void |
startGraphChart2DProperties(Attributes meta)
A container element start event handling method. |
void |
startGraphProperties(Attributes meta)
A container element start event handling method. |
void |
startLBChart2D(Attributes meta)
Handles opening of LBChart2D and registeres the chart type accordingly. |
void |
startLegendProperties(Attributes meta)
A container element start event handling method. |
void |
startLLChart2D(Attributes meta)
A container element start event handling method. |
void |
startMultiColorsProperties(Attributes meta)
Handles opening of MultiColorsProperties. |
void |
startPieChart2D(Attributes meta)
A container element start event handling method. |
void |
startSet(Attributes meta)
A container element start event handling method. |
void |
writeCache()
Writes the xpath query cache if possible. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Chart2DHandlerImpl(File dataRepository)
dataRepository - the directory to the logfiles,
can be null.| Method Detail |
|---|
public static void main(String[] args)
throws IOException
args - args the commandline aruments.
IOException - if a io problem occures.
public void handleGraphLabelsLinesStyle(Attributes meta)
throws SAXException
handleGraphLabelsLinesStyle in interface Chart2DHandlermeta - value or null
SAXException - in case of a parsing error.
public void startCategory(Attributes meta)
throws SAXException
startCategory in interface Chart2DHandlermeta - the attributes that come with the element.
SAXException - never.
public void endCategory()
throws SAXException
endCategory in interface Chart2DHandlerSAXException - never.
public void startMultiColorsProperties(Attributes meta)
throws SAXException
startMultiColorsProperties in interface Chart2DHandlermeta - the attributes that come with the element.
SAXException - never.
public void endMultiColorsProperties()
throws SAXException
endMultiColorsProperties in interface Chart2DHandlerSAXException - never.
public void startLBChart2D(Attributes meta)
throws SAXException
startLBChart2D in interface Chart2DHandlermeta - the attributes that come with the element.
SAXException - never.
public void endLBChart2D()
throws SAXException
endLBChart2D in interface Chart2DHandlerSAXException - in case of a parsing error.
public void handleLegendLabelsTexts(String data,
Attributes meta)
throws SAXException
Chart2DHandlerImpl for details.
handleLegendLabelsTexts in interface Chart2DHandlerdata - the element content.meta - attributes set with the element.
SAXException - if an error occurs.
public void startDataset(Attributes meta)
throws SAXException
startDataset in interface Chart2DHandlermeta - attributes
SAXException - in case of a parsing error.
public void endDataset()
throws SAXException
endDataset in interface Chart2DHandlerSAXException - if an error occures.
public void handlePieChart2DProperties(Attributes meta)
throws SAXException
handlePieChart2DProperties in interface Chart2DHandlermeta - attributes
SAXException - in case of a parsing error.
public void startGraphChart2DProperties(Attributes meta)
throws SAXException
startGraphChart2DProperties in interface Chart2DHandlermeta - attributes
SAXException - in case of a parsing error.
public void endGraphChart2DProperties()
throws SAXException
endGraphChart2DProperties in interface Chart2DHandlerSAXException - in case of a parsing error.
public void handleAxisLabelText(String data,
Attributes meta)
throws SAXException
handleAxisLabelText in interface Chart2DHandlerdata - value or nullmeta - attributes
SAXException - in case of a parsing error.
public void startChart2D(Attributes meta)
throws SAXException
startChart2D in interface Chart2DHandlermeta - attributes
SAXException - in case of a parsing error.
public void endChart2D()
throws SAXException
endChart2D in interface Chart2DHandlerSAXException - in case of a parsing error.
public void startLLChart2D(Attributes meta)
throws SAXException
startLLChart2D in interface Chart2DHandlermeta - attributes
SAXException - in case of a parsing error.
public void endLLChart2D()
throws SAXException
endLLChart2D in interface Chart2DHandlerSAXException - in case of a parsing error.
public void handleGraphNumbersLinesStyle(Attributes meta)
throws SAXException
handleGraphNumbersLinesStyle in interface Chart2DHandlermeta - value or null
SAXException - in case of a parsing error.
public void handleData(String data,
Attributes meta)
throws SAXException
handleData in interface Chart2DHandlerdata - value or nullmeta - attributes
SAXException - in case of a parsing error.
public void startPieChart2D(Attributes meta)
throws SAXException
startPieChart2D in interface Chart2DHandlermeta - attributes
SAXException - in case of a parsing error.
public void endPieChart2D()
throws SAXException
endPieChart2D in interface Chart2DHandlerSAXException - in case of a parsing error.
public void handleObject2DProperties(Attributes meta)
throws SAXException
handleObject2DProperties in interface Chart2DHandlermeta - value or null
SAXException - in case of a parsing error.
public void handleWarningRegionProperties(Attributes meta)
throws SAXException
handleWarningRegionProperties in interface Chart2DHandlermeta - value or null
SAXException - in case of a parsing error.
public void handleChart2DProperties(Attributes meta)
throws SAXException
handleChart2DProperties in interface Chart2DHandlermeta - value or null
SAXException - in case of a parsing error.
public void startSet(Attributes meta)
throws SAXException
startSet in interface Chart2DHandlermeta - attributes
SAXException - in case of a parsing error.
public void endSet()
throws SAXException
endSet in interface Chart2DHandlerSAXException - in case of a parsing error.
public void startGraphProperties(Attributes meta)
throws SAXException
startGraphProperties in interface Chart2DHandlermeta - attributes
SAXException - in case of a parsing error.
public void endGraphProperties()
throws SAXException
endGraphProperties in interface Chart2DHandlerSAXException - in case of a parsing error.
public void handleColorsCustom(String data,
Attributes meta)
throws SAXException
handleColorsCustom in interface Chart2DHandlerdata - value or nullmeta - attributes
SAXException - in case of a parsing error.
public void startLegendProperties(Attributes meta)
throws SAXException
startLegendProperties in interface Chart2DHandlermeta - attributes
SAXException - in case of a parsing error.
public void endLegendProperties()
throws SAXException
endLegendProperties in interface Chart2DHandlerSAXException - in case of a parsing error.public void writeCache()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||