com.sosnoski.xmlbench
Class BenchXerces2
java.lang.Object
|
+--com.sosnoski.xmlbench.BenchBase
|
+--com.sosnoski.xmlbench.BenchDocBase
|
+--com.sosnoski.xmlbench.BenchDOM
|
+--com.sosnoski.xmlbench.BenchXerces2
- Direct Known Subclasses:
- BenchXerces2Base, BenchXerces2Deferred
- public abstract class BenchXerces2
- extends BenchDOM
Abstract base class for benchmarks measuring performance of the Xerces2 DOM
document representation. This base class implementation can be customized
by subclasses to experiment with options for the representation, in
particular for trying the deferred node expansion feature of Xerces. The
code used for Xerces2 DOM is identical to that used for Xerces1, but is
compiled with a different classpath.
- Version:
- 1.2
- Author:
- Dennis M. Sosnoski
| Fields inherited from class com.sosnoski.xmlbench.BenchBase |
ATTRCHAR_COUNT_INDEX, ATTRIBUTE_COUNT_INDEX, AVERAGE_SPACE_INDEX, BUILD_AVERAGE_INDEX, BUILD_MIN_INDEX, CONTENT_COUNT_INDEX, DELTA_MEMORY_INDEX, ELEMENT_COUNT_INDEX, FIRST_SPACE_INDEX, GARBAGE_COLLECT_DELAY, GARBAGE_UNIT_DELAY, INITIAL_MEMORY_INDEX, m_configName, m_configVariant, m_lastMemory, m_lastTime, m_printPass, m_printStream, m_printSummary, MODIFY_AVERAGE_INDEX, MODIFY_MIN_INDEX, s_spaceFullDescriptions, s_spaceShortDescriptions, s_timeFullDescriptions, s_timeShortDescriptions, SERIALIZE_AVERAGE_INDEX, SERIALIZE_MIN_INDEX, SERIALIZE_SIZE_INDEX, SPACE_RESULT_COUNT, TEXT_AVERAGE_INDEX, TEXT_MIN_INDEX, TEXTCHAR_COUNT_INDEX, TIME_RESULT_COUNT, UNSERIALIZE_AVERAGE_INDEX, UNSERIALIZE_MIN_INDEX, WALK_AVERAGE_INDEX, WALK_MIN_INDEX, WALKED_SPACE_INDEX |
|
Constructor Summary |
protected |
BenchXerces2(java.lang.String config,
boolean defer)
Constructor. |
|
Method Summary |
protected java.lang.Object |
build(java.io.InputStream in)
Build document representation by parsing XML. |
protected void |
output(java.lang.Object doc,
java.io.OutputStream out)
Output a document as XML text. |
protected void |
reset()
Reset test class instance. |
protected void |
setDeferExpansion(boolean defer)
Set deferred node expansion mode. |
| Methods inherited from class com.sosnoski.xmlbench.BenchBase |
getName, initMemory, initTime, printSummary, reportSpace, reportTime, reportValue, setPrint, setShowDocument, setShowPass, setVariant, testPassSpace, testPassTime |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
BenchXerces2
protected BenchXerces2(java.lang.String config,
boolean defer)
- Constructor.
- Parameters:
config - test configuration namedefer - defer node expansion flag
setDeferExpansion
protected void setDeferExpansion(boolean defer)
- Set deferred node expansion mode.
- Parameters:
defer - defer node expansion flag
build
protected java.lang.Object build(java.io.InputStream in)
- Build document representation by parsing XML. This implementation
creates a DOM parser if one does not already exist, then reuses
that parser for the duration of a test run..
- Overrides:
build in class BenchDocBase
- Parameters:
in - XML document input stream- Returns:
- document representation
output
protected void output(java.lang.Object doc,
java.io.OutputStream out)
- Output a document as XML text. This method uses the method defined
by the Xerces DOM to output a text representation of the document.
- Overrides:
output in class BenchDocBase
- Parameters:
doc - document representation to be outputout - XML document output stream
reset
protected void reset()
- Reset test class instance. This discards the parser used
within a test pass.
- Overrides:
reset in class BenchDocBase