001: /*
002: * Licensed to the Apache Software Foundation (ASF) under one or more
003: * contributor license agreements. See the NOTICE file distributed with
004: * this work for additional information regarding copyright ownership.
005: * The ASF licenses this file to You under the Apache License, Version 2.0
006: * (the "License"); you may not use this file except in compliance with
007: * the License. You may obtain a copy of the License at
008: *
009: * http://www.apache.org/licenses/LICENSE-2.0
010: *
011: * Unless required by applicable law or agreed to in writing, software
012: * distributed under the License is distributed on an "AS IS" BASIS,
013: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014: * See the License for the specific language governing permissions and
015: * limitations under the License.
016: */
017:
018: package org.apache.xerces.impl.xs.opti;
019:
020: import org.w3c.dom.DOMConfiguration;
021: import org.w3c.dom.Attr;
022: import org.w3c.dom.Node;
023: import org.w3c.dom.Text;
024: import org.w3c.dom.Element;
025: import org.w3c.dom.Comment;
026: import org.w3c.dom.Document;
027: import org.w3c.dom.NodeList;
028: import org.w3c.dom.DocumentType;
029: import org.w3c.dom.CDATASection;
030: import org.w3c.dom.EntityReference;
031: import org.w3c.dom.DocumentFragment;
032: import org.w3c.dom.DOMImplementation;
033: import org.w3c.dom.ProcessingInstruction;
034:
035: import org.w3c.dom.DOMException;
036:
037: /**
038: * @xerces.internal
039: *
040: * @author Rahul Srivastava, Sun Microsystems Inc.
041: *
042: * @version $Id: DefaultDocument.java 446728 2006-09-15 20:43:46Z mrglavas $
043: */
044: public class DefaultDocument extends NodeImpl implements Document {
045:
046: private String fDocumentURI = null;
047:
048: // default constructor
049: public DefaultDocument() {
050: }
051:
052: //
053: // org.w3c.dom.Document methods
054: //
055:
056: public DocumentType getDoctype() {
057: return null;
058: }
059:
060: public DOMImplementation getImplementation() {
061: return null;
062: }
063:
064: public Element getDocumentElement() {
065: return null;
066: }
067:
068: public NodeList getElementsByTagName(String tagname) {
069: return null;
070: }
071:
072: public NodeList getElementsByTagNameNS(String namespaceURI,
073: String localName) {
074: return null;
075: }
076:
077: public Element getElementById(String elementId) {
078: return null;
079: }
080:
081: public Node importNode(Node importedNode, boolean deep)
082: throws DOMException {
083: throw new DOMException(DOMException.NOT_SUPPORTED_ERR,
084: "Method not supported");
085: }
086:
087: public Element createElement(String tagName) throws DOMException {
088: throw new DOMException(DOMException.NOT_SUPPORTED_ERR,
089: "Method not supported");
090: }
091:
092: public DocumentFragment createDocumentFragment() {
093: return null;
094: }
095:
096: public Text createTextNode(String data) {
097: return null;
098: }
099:
100: public Comment createComment(String data) {
101: return null;
102: }
103:
104: public CDATASection createCDATASection(String data)
105: throws DOMException {
106: throw new DOMException(DOMException.NOT_SUPPORTED_ERR,
107: "Method not supported");
108: }
109:
110: public ProcessingInstruction createProcessingInstruction(
111: String target, String data) throws DOMException {
112: throw new DOMException(DOMException.NOT_SUPPORTED_ERR,
113: "Method not supported");
114: }
115:
116: public Attr createAttribute(String name) throws DOMException {
117: throw new DOMException(DOMException.NOT_SUPPORTED_ERR,
118: "Method not supported");
119: }
120:
121: public EntityReference createEntityReference(String name)
122: throws DOMException {
123: throw new DOMException(DOMException.NOT_SUPPORTED_ERR,
124: "Method not supported");
125: }
126:
127: public Element createElementNS(String namespaceURI,
128: String qualifiedName) throws DOMException {
129: throw new DOMException(DOMException.NOT_SUPPORTED_ERR,
130: "Method not supported");
131: }
132:
133: public Attr createAttributeNS(String namespaceURI,
134: String qualifiedName) throws DOMException {
135: throw new DOMException(DOMException.NOT_SUPPORTED_ERR,
136: "Method not supported");
137: }
138:
139: // DOM Level 3 methods.
140:
141: public String getInputEncoding() {
142: return null;
143: }
144:
145: /**
146: public void setInputEncoding(String actualEncoding){
147: throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Method not supported");
148: }
149: */
150:
151: public String getXmlEncoding() {
152: return null;
153: }
154:
155: /**
156: * An attribute specifying, as part of the XML declaration, the encoding
157: * of this document. This is <code>null</code> when unspecified.
158: * @since DOM Level 3
159: public void setXmlEncoding(String encoding){
160: throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Method not supported");
161: }
162: */
163:
164: /**
165: * An attribute specifying, as part of the XML declaration, whether this
166: * document is standalone.
167: * <br> This attribute represents the property [standalone] defined in .
168: * @since DOM Level 3
169: */
170: public boolean getXmlStandalone() {
171: throw new DOMException(DOMException.NOT_SUPPORTED_ERR,
172: "Method not supported");
173: }
174:
175: /**
176: * An attribute specifying, as part of the XML declaration, whether this
177: * document is standalone.
178: * <br> This attribute represents the property [standalone] defined in .
179: * @since DOM Level 3
180: */
181: public void setXmlStandalone(boolean standalone) {
182: throw new DOMException(DOMException.NOT_SUPPORTED_ERR,
183: "Method not supported");
184: }
185:
186: /**
187: * An attribute specifying, as part of the XML declaration, the version
188: * number of this document. This is <code>null</code> when unspecified.
189: * <br> This attribute represents the property [version] defined in .
190: * @exception DOMException
191: * NOT_SUPPORTED_ERR: Raised if the version is set to a value that is
192: * not supported by this <code>Document</code>.
193: * @since DOM Level 3
194: */
195: public String getXmlVersion() {
196: return null;
197: }
198:
199: /**
200: * An attribute specifying, as part of the XML declaration, the version
201: * number of this document. This is <code>null</code> when unspecified.
202: * <br> This attribute represents the property [version] defined in .
203: * @exception DOMException
204: * NOT_SUPPORTED_ERR: Raised if the version is set to a value that is
205: * not supported by this <code>Document</code>.
206: * @since DOM Level 3
207: */
208: public void setXmlVersion(String version) throws DOMException {
209: throw new DOMException(DOMException.NOT_SUPPORTED_ERR,
210: "Method not supported");
211: }
212:
213: /**
214: * An attribute specifying whether errors checking is enforced or not.
215: * When set to <code>false</code>, the implementation is free to not
216: * test every possible error case normally defined on DOM operations,
217: * and not raise any <code>DOMException</code>. In case of error, the
218: * behavior is undefined. This attribute is <code>true</code> by
219: * defaults.
220: * @since DOM Level 3
221: */
222: public boolean getStrictErrorChecking() {
223: return false;
224: }
225:
226: /**
227: * An attribute specifying whether errors checking is enforced or not.
228: * When set to <code>false</code>, the implementation is free to not
229: * test every possible error case normally defined on DOM operations,
230: * and not raise any <code>DOMException</code>. In case of error, the
231: * behavior is undefined. This attribute is <code>true</code> by
232: * defaults.
233: * @since DOM Level 3
234: */
235: public void setStrictErrorChecking(boolean strictErrorChecking) {
236: throw new DOMException(DOMException.NOT_SUPPORTED_ERR,
237: "Method not supported");
238: }
239:
240: /**
241: * The location of the document or <code>null</code> if undefined.
242: * <br>Beware that when the <code>Document</code> supports the feature
243: * "HTML" , the href attribute of the HTML BASE element takes precedence
244: * over this attribute.
245: * @since DOM Level 3
246: */
247: public String getDocumentURI() {
248: return fDocumentURI;
249: }
250:
251: /**
252: * The location of the document or <code>null</code> if undefined.
253: * <br>Beware that when the <code>Document</code> supports the feature
254: * "HTML" , the href attribute of the HTML BASE element takes precedence
255: * over this attribute.
256: * @since DOM Level 3
257: */
258: public void setDocumentURI(String documentURI) {
259: fDocumentURI = documentURI;
260: }
261:
262: /** DOM Level 3*/
263: public Node adoptNode(Node source) throws DOMException {
264: throw new DOMException(DOMException.NOT_SUPPORTED_ERR,
265: "Method not supported");
266: }
267:
268: /** DOM Level 3*/
269: public void normalizeDocument() {
270: throw new DOMException(DOMException.NOT_SUPPORTED_ERR,
271: "Method not supported");
272: }
273:
274: /**
275: * The configuration used when <code>Document.normalizeDocument</code> is
276: * invoked.
277: * @since DOM Level 3
278: */
279: public DOMConfiguration getDomConfig() {
280: throw new DOMException(DOMException.NOT_SUPPORTED_ERR,
281: "Method not supported");
282: }
283:
284: /** DOM Level 3*/
285: public Node renameNode(Node n, String namespaceURI, String name)
286: throws DOMException {
287: throw new DOMException(DOMException.NOT_SUPPORTED_ERR,
288: "Method not supported");
289: }
290:
291: }
|