Source Code Cross Referenced for BuildDocument.java in  » Web-Server » Rimfaxe-Web-Server » com » rimfaxe » xml » xmlreader » 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 » Web Server » Rimfaxe Web Server » com.rimfaxe.xml.xmlreader 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        package com.rimfaxe.xml.xmlreader;
002:
003:        /** This class returns the DOM Document created by parsing XML.
004:
005:         <blockquote><small> Copyright (C) 2002 Hewlett-Packard Company.
006:         This file is part of Sparta, an XML Parser, DOM, and XPath library.
007:         This library is free software; you can redistribute it and/or
008:         modify it under the terms of the GNU Lesser General Public License
009:         as published by the Free Software Foundation; either version 2.1 of
010:         the License, or (at your option) any later version.  This library
011:         is distributed in the hope that it will be useful, but WITHOUT ANY
012:         WARRANTY; without even the implied warranty of MERCHANTABILITY or
013:         FITNESS FOR A PARTICULAR PURPOSE.</small></blockquote>
014:         @see <a "href="doc-files/LGPL.txt">GNU Lesser General Public License</a>
015:         @version  $Date: 2002/10/30 16:40:27 $  $Revision: 1.2 $
016:         @author Sergio Marti
017:         */
018:
019:        class BuildDocument implements  DocumentSource, ParseHandler {
020:
021:            public BuildDocument() {
022:                this (null);
023:            }
024:
025:            public BuildDocument(ParseLog log) {
026:                log_ = (log == null) ? DEFAULT_LOG : log;
027:            }
028:
029:            public void setParseSource(ParseSource ps) {
030:                parseSource_ = ps;
031:                doc_.setSystemId(ps.toString());
032:            }
033:
034:            public ParseSource getParseSource() {
035:                return parseSource_;
036:            }
037:
038:            public String toString() {
039:                if (parseSource_ != null)
040:                    return "BuildDoc: " + parseSource_.toString();
041:                else
042:                    return null;
043:            }
044:
045:            public String getSystemId() {
046:                if (parseSource_ != null)
047:                    return parseSource_.getSystemId();
048:                else
049:                    return null;
050:            }
051:
052:            public int getLineNumber() {
053:                if (parseSource_ != null)
054:                    return parseSource_.getLineNumber();
055:                else
056:                    return -1;
057:            }
058:
059:            /** The parsed document. */
060:            public Document getDocument() {
061:                return doc_;
062:            }
063:
064:            public void startDocument() {
065:            }
066:
067:            public void endDocument() {
068:                /* DEBUG
069:                   if (currentElement_ != null)
070:                   log_.warning("EndDocument: currentElement is not null",
071:                   getSystemId(), getLineNumber());
072:                 */
073:            }
074:
075:            public void startElement(Element element) {
076:                if (currentElement_ == null) {
077:                    doc_.setDocumentElement(element);
078:                } else {
079:                    currentElement_.appendChild(element);
080:                }
081:                currentElement_ = element;
082:            }
083:
084:            public void endElement(Element element) {
085:                /* DEBUG
086:                   if (isCENull())
087:                   return;
088:                   if (element != currentElement_) {
089:                   log_.warning("EndElement (" + element.getTagName() +
090:                   ") does not match currentElement (" +
091:                   currentElement_.getTagName() + ")", getSystemId(),
092:                   getLineNumber());
093:                   return;
094:                   }
095:                 */
096:
097:                currentElement_ = (Element) currentElement_.getParentNode();
098:            }
099:
100:            public void characters(char[] buf, int offset, int len) {
101:                /* DEBUG
102:                   if (isCENull())
103:                   return;
104:                 */
105:
106:                Element element = currentElement_;
107:                if (element.getLastChild() instanceof  Text) {
108:                    Text text = (Text) element.getLastChild();
109:                    text.appendData(buf, offset, len);
110:                } else {
111:                    Text text = new Text(new String(buf, offset, len));
112:                    element.appendChildNoChecking(text);
113:                }
114:            }
115:
116:            private boolean isCENull() {
117:                if (currentElement_ == null) {
118:                    log_.warning("currentElement is null", getSystemId(),
119:                            getLineNumber());
120:                    return true;
121:                } else
122:                    return false;
123:            }
124:
125:            private final ParseLog log_;
126:
127:            private Element currentElement_ = null;
128:            private final Document doc_ = new Document();
129:            private ParseSource parseSource_ = null;
130:        }
131:
132:        // $Log: BuildDocument.java,v $
133:        // Revision 1.2  2002/10/30 16:40:27  eobrain
134:        // appendChild no longer throws DOMException
135:        //
136:        // Revision 1.1.1.1  2002/08/19 05:04:02  eobrain
137:        // import from HP Labs internal CVS
138:        //
139:        // Revision 1.6  2002/08/18 04:30:54  eob
140:        // Make class package-private so as not to clutter up the javadoc.
141:        //
142:        // Revision 1.5  2002/08/17 19:04:36  eob
143:        // Add copyright and other formatting and commenting in preparation for
144:        // release to SourceForge.
145:        //
146:        // Revision 1.4  2002/08/15 22:51:37  eob
147:        // Sparta node constructors no longer needs document
148:        //
149:        // Revision 1.3  2002/08/05 20:04:31  sermarti
150:        //
151:        // Revision 1.2  2002/08/01 23:29:17  sermarti
152:        // Much faster Sparta parsing.
153:        // Has debug features enabled by default. Currently toggled
154:        // in ParseCharStream.java and recompiled.
155:        //
156:        // Revision 1.1  2002/07/25 21:10:15  sermarti
157:        // Adding files that mysteriously weren't added from Sparta before.
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.