Java Doc for SAX2RTFDTM.java in  » XML » xalan » org » apache » xml » dtm » ref » sax2dtm » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » XML » xalan » org.apache.xml.dtm.ref.sax2dtm 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


org.apache.xml.dtm.ref.sax2dtm.SAX2DTM
   org.apache.xml.dtm.ref.sax2dtm.SAX2RTFDTM

SAX2RTFDTM
public class SAX2RTFDTM extends SAX2DTM (Code)
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.


Field Summary
 intm_emptyCharsCount
    
 intm_emptyDataCount
    
 intm_emptyDataQNCount
    
 intm_emptyNSDeclSetCount
    
 intm_emptyNSDeclSetElemsCount
    
 intm_emptyNodeCount
    
 IntStackmark_char_size
    
 IntStackmark_data_size
    
 IntStackmark_doq_size
    
 IntStackmark_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.
 IntStackmark_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.
 IntStackmark_size
    

Constructor Summary
public  SAX2RTFDTM(DTMManager mgr, 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.
public  voidendDocument()
     Receive notification of the end of the document. %REVIEW% Y'know, this isn't all that much of a deoptimization.
public  intgetDocument()
     Given a DTM, find the owning document node.
public  intgetDocumentRoot(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). (I'm counting on the fact that getOwnerDocument() is implemented on top of this call, in the superclass, to avoid having to rewrite that one. Be careful if that code changes!)
Parameters:
  nodeHandle - the id of the node.
public  booleanisTreeIncomplete()
    
public  booleanpopRewindMark()
     "Tail-pruning" support for RTFs. This function pops the information previously saved by pushRewindMark (which see) and uses it to discard all nodes added to the DTM after that time.
public  voidpushRewindMark()
     "Tail-pruning" support for RTFs. This function pushes information about the current size of the DTM's data structures onto a stack, for use by popRewindMark() (which see). %REVIEW% I have no idea how to rewind m_elemIndexes.
public  voidstartDocument()
     Receive notification of the beginning of a new RTF document. %REVIEW% Y'know, this isn't all that much of a deoptimization.

Field Detail
m_emptyCharsCount
int m_emptyCharsCount(Code)
Tail-pruning mark: initial number of characters in use



m_emptyDataCount
int m_emptyDataCount(Code)
Tail-pruning mark: initial number of data items in use



m_emptyDataQNCount
int m_emptyDataQNCount(Code)
Tail-pruning mark: default initial number of dataOrQName slots in use



m_emptyNSDeclSetCount
int m_emptyNSDeclSetCount(Code)
Tail-pruning mark: initial number of namespace declaration sets



m_emptyNSDeclSetElemsCount
int m_emptyNSDeclSetElemsCount(Code)
Tail-pruning mark: initial number of namespace declaration elements



m_emptyNodeCount
int m_emptyNodeCount(Code)
Tail-pruning mark: initial number of nodes in use



mark_char_size
IntStack mark_char_size(Code)
Tail-pruning mark: Number of size-of-data fields in use



mark_data_size
IntStack mark_data_size(Code)
Tail-pruning mark: Number of data items in use



mark_doq_size
IntStack mark_doq_size(Code)
Tail-pruning mark: Number of dataOrQName slots in use



mark_nsdeclelem_size
IntStack mark_nsdeclelem_size(Code)
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. We can probabably reduce these to a single stack and save some storage.



mark_nsdeclset_size
IntStack mark_nsdeclset_size(Code)
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. We can probabably reduce these to a single stack and save some storage.



mark_size
IntStack mark_size(Code)
Tail-pruning mark: Number of nodes in use




Constructor Detail
SAX2RTFDTM
public SAX2RTFDTM(DTMManager mgr, Source source, int dtmIdentity, DTMWSFilter whiteSpaceFilter, XMLStringFactory xstringfactory, boolean doIndexing)(Code)




Method Detail
_documentRoot
protected int _documentRoot(int nodeIdentifier)(Code)
Given a node identifier, find the owning document node. Unlike the DOM, this considers the owningDocument of a Document to be itself. Note that in shared DTMs this may not be zero.
Parameters:
  nodeIdentifier - the id of the starting node. int Node identifier of the root of this DTM tree



endDocument
public void endDocument() throws SAXException(Code)
Receive notification of the end of the document. %REVIEW% Y'know, this isn't all that much of a deoptimization. We might want to consider folding the start/endDocument changes back into the main SAX2DTM so we don't have to expose so many fields (even as Protected).
throws:
  SAXException - Any SAX exception, possiblywrapping another exception.
See Also:   org.xml.sax.ContentHandler.endDocument



getDocument
public int getDocument()(Code)
Given a DTM, find the owning document node. In the case of SAX2RTFDTM, which may contain multiple documents, this returns the most recently started document, or null if the DTM is empty or no document is currently under construction. %REVIEW% Should we continue to report the most recent after construction has ended? I think not, given that it may have been tail-pruned. int Node handle of Document node, or null if this DTM does notcontain an "active" document.



getDocumentRoot
public int getDocumentRoot(int nodeHandle)(Code)
Given a node handle, find the owning document node, using DTM semantics (Document owns itself) rather than DOM semantics (Document has no owner). (I'm counting on the fact that getOwnerDocument() is implemented on top of this call, in the superclass, to avoid having to rewrite that one. Be careful if that code changes!)
Parameters:
  nodeHandle - the id of the node. int Node handle of owning document



isTreeIncomplete
public boolean isTreeIncomplete()(Code)
true if a DTM tree is currently under construction.



popRewindMark
public boolean popRewindMark()(Code)
"Tail-pruning" support for RTFs. This function pops the information previously saved by pushRewindMark (which see) and uses it to discard all nodes added to the DTM after that time. We expect that this will allow us to reuse storage more effectively. This is _not_ intended to be called while a document is still being constructed -- only between endDocument and the next startDocument %REVIEW% WARNING: This is the first use of some of the truncation methods. If Xalan blows up after this is called, that's a likely place to check. %REVIEW% Our original design for DTMs permitted them to share string pools. If there any risk that this might be happening, we can _not_ rewind and recover the string storage. One solution might to assert that DTMs used for RTFs Must Not take advantage of that feature, but this seems excessively fragile. Another, much less attractive, would be to just let them leak... Nah. true if and only if the pop completely emptied theRTF. That response is used when determining how to unspoolRTF-started-while-RTF-open situations.



pushRewindMark
public void pushRewindMark()(Code)
"Tail-pruning" support for RTFs. This function pushes information about the current size of the DTM's data structures onto a stack, for use by popRewindMark() (which see). %REVIEW% I have no idea how to rewind m_elemIndexes. However, RTFs will not be indexed, so I can simply panic if that case arises. Hey, it works...



startDocument
public void startDocument() throws SAXException(Code)
Receive notification of the beginning of a new RTF document. %REVIEW% Y'know, this isn't all that much of a deoptimization. We might want to consider folding the start/endDocument changes back into the main SAX2DTM so we don't have to expose so many fields (even as Protected) and carry the additional code.
throws:
  SAXException - Any SAX exception, possiblywrapping another exception.
See Also:   org.xml.sax.ContentHandler.startDocument



Fields inherited from org.apache.xml.dtm.ref.sax2dtm.SAX2DTM
protected FastStringBuffer m_chars(Code)(Java Doc)
protected transient int m_coalescedTextType(Code)(Java Doc)
protected transient IntStack m_contextIndexes(Code)(Java Doc)
protected SuballocatedIntVector m_data(Code)(Java Doc)
protected SuballocatedIntVector m_dataOrQName(Code)(Java Doc)
protected boolean m_endDocumentOccured(Code)(Java Doc)
protected Hashtable m_idAttributes(Code)(Java Doc)
protected transient boolean m_insideDTD(Code)(Java Doc)
protected transient Locator m_locator(Code)(Java Doc)
protected transient IntStack m_parents(Code)(Java Doc)
boolean m_pastFirstElement(Code)(Java Doc)
protected transient java.util.Vector m_prefixMappings(Code)(Java Doc)
protected transient int m_previous(Code)(Java Doc)
protected IntVector m_sourceColumn(Code)(Java Doc)
protected IntVector m_sourceLine(Code)(Java Doc)
protected StringVector m_sourceSystemId(Code)(Java Doc)
protected int m_textPendingStart(Code)(Java Doc)
protected transient int m_textType(Code)(Java Doc)
protected boolean m_useSourceLocationProperty(Code)(Java Doc)
protected DTMStringPool m_valuesOrPrefixes(Code)(Java Doc)
protected DTMTreeWalker m_walker(Code)(Java Doc)

Methods inherited from org.apache.xml.dtm.ref.sax2dtm.SAX2DTM
protected int _dataOrQName(int identity)(Code)(Java Doc)
protected void addNewDTMID(int nodeIndex)(Code)(Java Doc)
protected int addNode(int type, int expandedTypeID, int parentIndex, int previousSibling, int dataOrPrefix, boolean canHaveFirstChild)(Code)(Java Doc)
public void attributeDecl(String eName, String aName, String type, String valueDefault, String value) throws SAXException(Code)(Java Doc)
public void characters(char ch, int start, int length) throws SAXException(Code)(Java Doc)
protected void charactersFlush()(Code)(Java Doc)
public void clearCoRoutine()(Code)(Java Doc)
public void clearCoRoutine(boolean callDoTerminate)(Code)(Java Doc)
public void comment(char ch, int start, int length) throws SAXException(Code)(Java Doc)
protected boolean declAlreadyDeclared(String prefix)(Code)(Java Doc)
public void dispatchCharactersEvents(int nodeHandle, ContentHandler ch, boolean normalize) throws SAXException(Code)(Java Doc)
public void dispatchToEvents(int nodeHandle, org.xml.sax.ContentHandler ch) throws org.xml.sax.SAXException(Code)(Java Doc)
public void elementDecl(String name, String model) throws SAXException(Code)(Java Doc)
public void endCDATA() throws SAXException(Code)(Java Doc)
public void endDTD() throws SAXException(Code)(Java Doc)
public void endDocument() throws SAXException(Code)(Java Doc)
public void endElement(String uri, String localName, String qName) throws SAXException(Code)(Java Doc)
public void endEntity(String name) throws SAXException(Code)(Java Doc)
public void endPrefixMapping(String prefix) throws SAXException(Code)(Java Doc)
public void error(SAXParseException e) throws SAXException(Code)(Java Doc)
public void externalEntityDecl(String name, String publicId, String systemId) throws SAXException(Code)(Java Doc)
public void fatalError(SAXParseException e) throws SAXException(Code)(Java Doc)
public int getAttributeNode(int nodeHandle, String namespaceURI, String name)(Code)(Java Doc)
public ContentHandler getContentHandler()(Code)(Java Doc)
public DTDHandler getDTDHandler()(Code)(Java Doc)
public DeclHandler getDeclHandler()(Code)(Java Doc)
public String getDocumentTypeDeclarationPublicIdentifier()(Code)(Java Doc)
public String getDocumentTypeDeclarationSystemIdentifier()(Code)(Java Doc)
public int getElementById(String elementId)(Code)(Java Doc)
public EntityResolver getEntityResolver()(Code)(Java Doc)
public ErrorHandler getErrorHandler()(Code)(Java Doc)
public String getFixedNames(int type)(Code)(Java Doc)
public int getIdForNamespace(String uri)(Code)(Java Doc)
public LexicalHandler getLexicalHandler()(Code)(Java Doc)
public String getLocalName(int nodeHandle)(Code)(Java Doc)
public String getNamespaceURI(int nodeHandle)(Code)(Java Doc)
public String getNamespaceURI(String prefix)(Code)(Java Doc)
protected int getNextNodeIdentity(int identity)(Code)(Java Doc)
public String getNodeName(int nodeHandle)(Code)(Java Doc)
public String getNodeNameX(int nodeHandle)(Code)(Java Doc)
public String getNodeValue(int nodeHandle)(Code)(Java Doc)
public int getNumberOfNodes()(Code)(Java Doc)
public String getPrefix(int nodeHandle)(Code)(Java Doc)
public String getPrefix(String qname, String uri)(Code)(Java Doc)
public SourceLocator getSourceLocatorFor(int node)(Code)(Java Doc)
public XMLString getStringValue(int nodeHandle)(Code)(Java Doc)
public String getUnparsedEntityURI(String name)(Code)(Java Doc)
public void ignorableWhitespace(char ch, int start, int length) throws SAXException(Code)(Java Doc)
public void internalEntityDecl(String name, String value) throws SAXException(Code)(Java Doc)
public boolean isAttributeSpecified(int attributeHandle)(Code)(Java Doc)
public boolean isWhitespace(int nodeHandle)(Code)(Java Doc)
public void migrateTo(DTMManager manager)(Code)(Java Doc)
public boolean needsTwoThreads()(Code)(Java Doc)
protected boolean nextNode()(Code)(Java Doc)
public void notationDecl(String name, String publicId, String systemId) throws SAXException(Code)(Java Doc)
public void processingInstruction(String target, String data) throws SAXException(Code)(Java Doc)
public InputSource resolveEntity(String publicId, String systemId) throws SAXException(Code)(Java Doc)
public void setDocumentLocator(Locator locator)(Code)(Java Doc)
public void setIDAttribute(String id, int elem)(Code)(Java Doc)
public void setIncrementalSAXSource(IncrementalSAXSource incrementalSAXSource)(Code)(Java Doc)
public void setProperty(String property, Object value)(Code)(Java Doc)
protected void setSourceLocation()(Code)(Java Doc)
public void setUseSourceLocation(boolean useSourceLocation)(Code)(Java Doc)
public void skippedEntity(String name) throws SAXException(Code)(Java Doc)
public void startCDATA() throws SAXException(Code)(Java Doc)
public void startDTD(String name, String publicId, String systemId) throws SAXException(Code)(Java Doc)
public void startDocument() throws SAXException(Code)(Java Doc)
public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException(Code)(Java Doc)
public void startEntity(String name) throws SAXException(Code)(Java Doc)
public void startPrefixMapping(String prefix, String uri) throws SAXException(Code)(Java Doc)
public void unparsedEntityDecl(String name, String publicId, String systemId, String notationName) throws SAXException(Code)(Java Doc)
public void warning(SAXParseException e) throws SAXException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.