|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.xml.dtm.ref.DTMDefaultBase org.apache.xml.dtm.ref.DTMDefaultBaseTraversers org.apache.xml.dtm.ref.DTMDefaultBaseIterators org.apache.xml.dtm.ref.sax2dtm.SAX2DTM org.apache.xml.dtm.ref.sax2dtm.SAX2RTFDTM
public class SAX2RTFDTM
This is a subclass of SAX2DTM which has been modified to meet the needs of Result Tree Frameworks (RTFs). The differences are: 1) Multiple XML trees may be appended to the single DTM. This means that the root node of each document is _not_ node 0. Some code has had to be deoptimized to support this mode of operation, and an explicit mechanism for obtaining the Node Handle of the root node has been provided. 2) A stack of these documents is maintained, allowing us to "tail-prune" the most recently added trees off the end of the DTM as stylesheet elements (and thus variable contexts) are exited. PLEASE NOTE that this class may be _heavily_ dependent upon the internals of the SAX2DTM superclass, and must be maintained in parallel with that code. Arguably, they should be conditionals within a single class... but they have deen separated for performance reasons. (In fact, one could even argue about which is the superclass and which is the subclass; the current arrangement is as much about preserving stability of existing code during development as anything else.) %REVIEW% In fact, since the differences are so minor, I think it may be possible/practical to fold them back into the base SAX2DTM. Consider that as a future code-size optimization.
Nested Class Summary |
---|
Field Summary | |
---|---|
private static boolean |
DEBUG
Set true to monitor SAX events and similar diagnostic info. |
private int |
m_currentDocumentNode
Most recently started Document, or null if the DTM is empty. |
(package private) int |
m_emptyCharsCount
Tail-pruning mark: initial number of characters in use |
(package private) int |
m_emptyDataCount
Tail-pruning mark: initial number of data items in use |
(package private) int |
m_emptyDataQNCount
Tail-pruning mark: default initial number of dataOrQName slots in use |
(package private) int |
m_emptyNodeCount
Tail-pruning mark: initial number of nodes in use |
(package private) int |
m_emptyNSDeclSetCount
Tail-pruning mark: initial number of namespace declaration sets |
(package private) int |
m_emptyNSDeclSetElemsCount
Tail-pruning mark: initial number of namespace declaration elements |
(package private) IntStack |
mark_char_size
Tail-pruning mark: Number of size-of-data fields in use |
(package private) IntStack |
mark_data_size
Tail-pruning mark: Number of data items in use |
(package private) IntStack |
mark_doq_size
Tail-pruning mark: Number of dataOrQName slots in use |
(package private) IntStack |
mark_nsdeclelem_size
Tail-pruning mark: Number of naespace declaration elements in use %REVIEW% I don't think number of NS sets is ever different from number of NS elements. |
(package private) IntStack |
mark_nsdeclset_size
Tail-pruning mark: Number of namespace declaration sets in use %REVIEW% I don't think number of NS sets is ever different from number of NS elements. |
(package private) IntStack |
mark_size
Tail-pruning mark: Number of nodes in use |
Fields inherited from class org.apache.xml.dtm.ref.sax2dtm.SAX2DTM |
---|
m_chars, m_coalescedTextType, m_contextIndexes, m_data, m_dataOrQName, m_endDocumentOccured, m_idAttributes, m_insideDTD, m_locator, m_parents, m_pastFirstElement, m_prefixMappings, m_previous, m_sourceColumn, m_sourceLine, m_sourceSystemId, m_textPendingStart, m_textType, m_useSourceLocationProperty, m_valuesOrPrefixes, m_walker |
Fields inherited from class org.apache.xml.dtm.ref.DTMDefaultBase |
---|
DEFAULT_BLOCKSIZE, DEFAULT_NUMBLOCKS, DEFAULT_NUMBLOCKS_SMALL, m_documentBaseURI, m_dtmIdent, m_elemIndexes, m_expandedNameTable, m_exptype, m_firstch, m_indexing, m_mgr, m_mgrDefault, m_namespaceDeclSetElements, m_namespaceDeclSets, m_nextsib, m_parent, m_prevsib, m_shouldStripWhitespaceStack, m_shouldStripWS, m_size, m_traversers, m_wsfilter, m_xstrf, NOTPROCESSED, ROOTNODE |
Fields inherited from interface org.apache.xml.dtm.DTM |
---|
ATTRIBUTE_NODE, CDATA_SECTION_NODE, COMMENT_NODE, DOCUMENT_FRAGMENT_NODE, DOCUMENT_NODE, DOCUMENT_TYPE_NODE, ELEMENT_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE, NAMESPACE_NODE, NOTATION_NODE, NTYPES, NULL, PROCESSING_INSTRUCTION_NODE, ROOT_NODE, TEXT_NODE |
Constructor Summary | |
---|---|
SAX2RTFDTM(DTMManager mgr,
javax.xml.transform.Source source,
int dtmIdentity,
DTMWSFilter whiteSpaceFilter,
XMLStringFactory xstringfactory,
boolean doIndexing)
|
Method Summary | |
---|---|
protected int |
_documentRoot(int nodeIdentifier)
Given a node identifier, find the owning document node. |
void |
endDocument()
Receive notification of the end of the document. |
int |
getDocument()
Given a DTM, find the owning document node. |
int |
getDocumentRoot(int nodeHandle)
Given a node handle, find the owning document node, using DTM semantics (Document owns itself) rather than DOM semantics (Document has no owner). |
boolean |
isTreeIncomplete()
|
boolean |
popRewindMark()
"Tail-pruning" support for RTFs. |
void |
pushRewindMark()
"Tail-pruning" support for RTFs. |
void |
startDocument()
Receive notification of the beginning of a new RTF document. |
Methods inherited from class org.apache.xml.dtm.ref.DTMDefaultBaseIterators |
---|
getAxisIterator, getTypedAxisIterator |
Methods inherited from class org.apache.xml.dtm.ref.DTMDefaultBaseTraversers |
---|
getAxisTraverser |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final boolean DEBUG
private int m_currentDocumentNode
IntStack mark_size
IntStack mark_data_size
IntStack mark_char_size
IntStack mark_doq_size
IntStack mark_nsdeclset_size
IntStack mark_nsdeclelem_size
int m_emptyNodeCount
int m_emptyNSDeclSetCount
int m_emptyNSDeclSetElemsCount
int m_emptyDataCount
int m_emptyCharsCount
int m_emptyDataQNCount
Constructor Detail |
---|
public SAX2RTFDTM(DTMManager mgr, javax.xml.transform.Source source, int dtmIdentity, DTMWSFilter whiteSpaceFilter, XMLStringFactory xstringfactory, boolean doIndexing)
Method Detail |
---|
public int getDocument()
getDocument
in interface DTM
getDocument
in class DTMDefaultBase
public int getDocumentRoot(int nodeHandle)
getDocumentRoot
in interface DTM
getDocumentRoot
in class DTMDefaultBase
nodeHandle
- the id of the node.
DTM.getOwnerDocument(int nodeHandle)
protected int _documentRoot(int nodeIdentifier)
nodeIdentifier
- the id of the starting node.
public void startDocument() throws org.xml.sax.SAXException
startDocument
in interface org.xml.sax.ContentHandler
startDocument
in class SAX2DTM
org.xml.sax.SAXException
- Any SAX exception, possibly
wrapping another exception.ContentHandler.startDocument()
public void endDocument() throws org.xml.sax.SAXException
endDocument
in interface org.xml.sax.ContentHandler
endDocument
in class SAX2DTM
org.xml.sax.SAXException
- Any SAX exception, possibly
wrapping another exception.ContentHandler.endDocument()
public void pushRewindMark()
public boolean popRewindMark()
public boolean isTreeIncomplete()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |