| java.lang.Object com.sosnoski.xmlbench.BenchBase com.sosnoski.xmlbench.BenchDocBase com.sosnoski.xmlbench.BenchJDOM
BenchJDOM | public class BenchJDOM extends BenchDocBase (Code) | | Benchmark for measuring performance of the JDOM document representation.
author: Dennis M. Sosnoski version: 1.2 |
Constructor Summary | |
public | BenchJDOM() Constructor. |
BenchJDOM | public BenchJDOM()(Code) | | Constructor.
|
build | protected Object build(InputStream in)(Code) | | Build document representation by parsing XML. This implementation
creates a SAX builder if one does not already exist, then reuses
that builder for the duration of a test run..
Parameters: in - XML document input stream document representation |
modify | protected void modify(Object doc)(Code) | | Modify a document representation. This implementation of the abstract
superclass method walks the document representation performing the
following modifications: remove all content segments which consist only
of whitespace; add an attribute "text" set to "true" to any elements
which directly contain non-whitespace text content; and replace each
non-whitespace text content segment with a "text" element which wraps
the trimmed content.
Parameters: doc - document representation to be modified |
modifyElement | protected void modifyElement(Element element)(Code) | | Modify subtree for element. This recursively walks through the document
nodes under an element, performing the modifications.
Parameters: element - element to be walked |
output | protected void output(Object doc, OutputStream out)(Code) | | Output a document as XML text. This method uses the method defined
by JDOM to output a text representation of the document.
Parameters: doc - document representation to be output Parameters: out - XML document output stream |
reset | protected void reset()(Code) | | Reset test class instance. This discards the SAX builder used
within a test pass.
|
walk | protected void walk(Object doc, DocumentSummary summary)(Code) | | Walk and summarize document. This method walks through the nodes
of the document, accumulating summary information.
Parameters: doc - document representation to be walked Parameters: summary - output document summary information |
walkElement | protected void walkElement(Element element, DocumentSummary summary)(Code) | | Walk subtree for element. This recursively walks through the document
nodes under an element, accumulating summary information.
Parameters: element - element to be walked Parameters: summary - document summary information |
|
|