~ubuntu-branches/ubuntu/vivid/herold/vivid

« back to all changes in this revision

Viewing changes to java/org/dbdoclet/xiphias/dom/DocumentImpl.java

  • Committer: Package Import Robot
  • Author(s): Mathieu Malaterre
  • Date: 2012-09-20 10:00:14 UTC
  • Revision ID: package-import@ubuntu.com-20120920100014-5pcwbw2err6on8yg
Tags: upstream-6.0.1
ImportĀ upstreamĀ versionĀ 6.0.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* 
 
2
 * Copyright (C) 2001-2012 Michael Fuchs
 
3
 *
 
4
 * This file is part of herold.
 
5
 * 
 
6
 * herold is free software: you can redistribute it and/or modify
 
7
 * it under the terms of the GNU General Public License as published by
 
8
 * the Free Software Foundation, either version 3 of the License, or
 
9
 * (at your option) any later version.
 
10
 * 
 
11
 * herold is distributed in the hope that it will be useful,
 
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
14
 * GNU General Public License for more details.
 
15
 * 
 
16
 * You should have received a copy of the GNU General Public License
 
17
 * along with herold.  If not, see <http://www.gnu.org/licenses/>.  
 
18
 */
 
19
package org.dbdoclet.xiphias.dom;
 
20
 
 
21
import org.w3c.dom.Attr;
 
22
import org.w3c.dom.CDATASection;
 
23
import org.w3c.dom.Comment;
 
24
import org.w3c.dom.DOMConfiguration;
 
25
import org.w3c.dom.DOMException;
 
26
import org.w3c.dom.DOMImplementation;
 
27
import org.w3c.dom.Document;
 
28
import org.w3c.dom.DocumentFragment;
 
29
import org.w3c.dom.DocumentType;
 
30
import org.w3c.dom.Element;
 
31
import org.w3c.dom.EntityReference;
 
32
import org.w3c.dom.Node;
 
33
import org.w3c.dom.NodeList;
 
34
import org.w3c.dom.ProcessingInstruction;
 
35
import org.w3c.dom.Text;
 
36
 
 
37
public class DocumentImpl extends NodeImpl implements Document {
 
38
 
 
39
        private String xmlEncoding = "UTF-8";
 
40
        private String xmlVersion = "1.0";
 
41
        private ElementImpl documentElement;
 
42
        private DocumentType docType;
 
43
 
 
44
        public DocumentImpl() {
 
45
 
 
46
                super("#document", null);
 
47
                setNodeType(DOCUMENT_NODE);
 
48
 
 
49
                setXmlEncoding("UTF-8");
 
50
                setXmlVersion("1.0");
 
51
        }
 
52
 
 
53
        public Node adoptNode(Node source) throws DOMException {
 
54
                throw new IllegalStateException("Not yet implemented");
 
55
        }
 
56
 
 
57
        public Attr createAttribute(String name) throws DOMException {
 
58
                throw new IllegalStateException("Not yet implemented");
 
59
        }
 
60
 
 
61
        public Attr createAttributeNS(String namespaceURI, String qualifiedName)
 
62
                        throws DOMException {
 
63
                throw new IllegalStateException("Not yet implemented");
 
64
        }
 
65
 
 
66
        public CDATASection createCDATASection(String data) throws DOMException {
 
67
                throw new IllegalStateException("Not yet implemented");
 
68
        }
 
69
 
 
70
        public Comment createComment(String data) {
 
71
                throw new IllegalStateException("Not yet implemented");
 
72
        }
 
73
 
 
74
        public DocumentFragment createDocumentFragment() {
 
75
                throw new IllegalStateException("Not yet implemented");
 
76
        }
 
77
 
 
78
        public ElementImpl createElement(String tagName) throws DOMException {
 
79
 
 
80
                ElementImpl elem = new ElementImpl(tagName);
 
81
                elem.setDocument(this);
 
82
                elem.setFormatType(FORMAT_BLOCK);
 
83
                return elem;
 
84
        }
 
85
 
 
86
        public Element createElementNS(String namespaceURI, String qualifiedName)
 
87
                        throws DOMException {
 
88
                throw new IllegalStateException("Not yet implemented");
 
89
        }
 
90
 
 
91
        public EntityReference createEntityReference(String name)
 
92
                        throws DOMException {
 
93
                throw new IllegalStateException("Not yet implemented");
 
94
        }
 
95
 
 
96
        public ProcessingInstruction createProcessingInstruction(String target,
 
97
                        String data) throws DOMException {
 
98
                throw new IllegalStateException("Not yet implemented");
 
99
        }
 
100
 
 
101
        public Text createTextNode(String data) {
 
102
 
 
103
                TextImpl text = new TextImpl(data);
 
104
                return text;
 
105
        }
 
106
 
 
107
        public String createXmlDeclaration() {
 
108
                return "<?xml version=\"" + xmlVersion + "\" encoding=\"" + xmlEncoding
 
109
                                + "\"?>\n";
 
110
        }
 
111
 
 
112
        public DocumentType getDoctype() {
 
113
                return docType;
 
114
        }
 
115
 
 
116
        public ElementImpl getDocumentElement() {
 
117
                return documentElement;
 
118
        }
 
119
 
 
120
        public String getDocumentURI() {
 
121
                throw new IllegalStateException("Not yet implemented");
 
122
        }
 
123
 
 
124
        public DOMConfiguration getDomConfig() {
 
125
                throw new IllegalStateException("Not yet implemented");
 
126
        }
 
127
 
 
128
        public Element getElementById(String elementId) {
 
129
                throw new IllegalStateException("Not yet implemented");
 
130
        }
 
131
 
 
132
        public NodeList getElementsByTagName(String tagname) {
 
133
                throw new IllegalStateException("Not yet implemented");
 
134
        }
 
135
 
 
136
        public NodeList getElementsByTagNameNS(String namespaceURI, String localName) {
 
137
                throw new IllegalStateException("Not yet implemented");
 
138
        }
 
139
 
 
140
        public DOMImplementation getImplementation() {
 
141
                throw new IllegalStateException("Not yet implemented");
 
142
        }
 
143
 
 
144
        public String getInputEncoding() {
 
145
                throw new IllegalStateException("Not yet implemented");
 
146
        }
 
147
 
 
148
        public boolean getStrictErrorChecking() {
 
149
                throw new IllegalStateException("Not yet implemented");
 
150
        }
 
151
 
 
152
        public String getXmlEncoding() {
 
153
                return xmlEncoding;
 
154
        }
 
155
 
 
156
        public boolean getXmlStandalone() {
 
157
                throw new IllegalStateException("Not yet implemented");
 
158
        }
 
159
 
 
160
        public String getXmlVersion() {
 
161
                return xmlVersion;
 
162
        }
 
163
 
 
164
        public Node importNode(Node importedNode, boolean deep) throws DOMException {
 
165
                throw new IllegalStateException("Not yet implemented");
 
166
        }
 
167
 
 
168
        public void normalizeDocument() {
 
169
                throw new IllegalStateException("Not yet implemented");
 
170
 
 
171
        }
 
172
 
 
173
        public Node renameNode(Node n, String namespaceURI, String qualifiedName)
 
174
                        throws DOMException {
 
175
                throw new IllegalStateException("Not yet implemented");
 
176
        }
 
177
 
 
178
        public void setDocumentElement(ElementImpl documentElement) {
 
179
                this.documentElement = documentElement;
 
180
        }
 
181
 
 
182
        public void setDoctype(DocumentType docType) {
 
183
                this.docType = docType;
 
184
        }
 
185
 
 
186
        public void setDocumentURI(String documentURI) {
 
187
                throw new IllegalStateException("Not yet implemented");
 
188
 
 
189
        }
 
190
 
 
191
        public void setStrictErrorChecking(boolean strictErrorChecking) {
 
192
                throw new IllegalStateException("Not yet implemented");
 
193
 
 
194
        }
 
195
 
 
196
        public void setXmlEncoding(String xmlEncoding) {
 
197
                this.xmlEncoding = xmlEncoding;
 
198
        }
 
199
 
 
200
        public void setXmlStandalone(boolean xmlStandalone) throws DOMException {
 
201
                throw new IllegalStateException("Not yet implemented");
 
202
 
 
203
        }
 
204
 
 
205
        public void setXmlVersion(String xmlVersion) throws DOMException {
 
206
                this.xmlVersion = xmlVersion;
 
207
 
 
208
        }
 
209
}