001: package com.rimfaxe.xml.compatibility;
002:
003: import org.w3c.dom.*;
004:
005: /**
006: * Standard wrapper around spartan Text node.
007:
008: <blockquote><small> Copyright (C) 2002 Hewlett-Packard Company.
009: This file is part of Sparta, an XML Parser, DOM, and XPath library.
010: This library is free software; you can redistribute it and/or
011: modify it under the terms of the <a href="doc-files/LGPL.txt">GNU
012: Lesser General Public License</a> as published by the Free Software
013: Foundation; either version 2.1 of the License, or (at your option)
014: any later version. This library is distributed in the hope that it
015: will be useful, but WITHOUT ANY WARRANTY; without even the implied
016: warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
017: PURPOSE. </small></blockquote>
018: @version $Date: 2002/11/06 02:59:55 $ $Revision: 1.3 $
019: @author Eamonn O'Brien-Strain
020: */
021:
022: public class TextImpl extends NodeImpl implements org.w3c.dom.Text,
023: org.w3c.dom.CDATASection {
024:
025: public Text splitText(int parm1) throws org.w3c.dom.DOMException {
026: /**@todo: Implement this org.w3c.dom.Text method*/
027: throw new Error("not implemented: splitText()");
028: }
029:
030: public void appendData(String parm1)
031: throws org.w3c.dom.DOMException {
032: /**@todo: Implement this org.w3c.dom.CharacterData method*/
033: throw new Error("not implemented: appendData()");
034: }
035:
036: public void deleteData(int parm1, int parm2)
037: throws org.w3c.dom.DOMException {
038: /**@todo: Implement this org.w3c.dom.CharacterData method*/
039: throw new Error("not implemented: deleteData()");
040: }
041:
042: public String getData() throws org.w3c.dom.DOMException {
043: return getSpartanText().getData();
044: }
045:
046: public int getLength() {
047: /**@todo: Implement this org.w3c.dom.CharacterData method*/
048: throw new Error("not implemented: getLength()");
049: }
050:
051: public void insertData(int parm1, String parm2)
052: throws org.w3c.dom.DOMException {
053: /**@todo: Implement this org.w3c.dom.CharacterData method*/
054: throw new Error("not implemented: insertData()");
055: }
056:
057: public void replaceData(int parm1, int parm2, String parm3)
058: throws org.w3c.dom.DOMException {
059: /**@todo: Implement this org.w3c.dom.CharacterData method*/
060: throw new Error("not implemented: replaceData()");
061: }
062:
063: public void setData(String parm1) throws org.w3c.dom.DOMException {
064: /**@todo: Implement this org.w3c.dom.CharacterData method*/
065: throw new Error("not implemented: setData()");
066: }
067:
068: public String substringData(int parm1, int parm2)
069: throws org.w3c.dom.DOMException {
070: /**@todo: Implement this org.w3c.dom.CharacterData method*/
071: throw new Error("not implemented: substringData()");
072: }
073:
074: public Node appendChild(Node parm1) throws org.w3c.dom.DOMException {
075: /**@todo: Implement this org.w3c.dom.Node method*/
076: throw new Error("not implemented: appendChild()");
077: }
078:
079: public Node cloneNode(boolean parm1) {
080: /**@todo: Implement this org.w3c.dom.Node method*/
081: throw new Error("not implemented: cloneNode()");
082: }
083:
084: public NamedNodeMap getAttributes() {
085: /**@todo: Implement this org.w3c.dom.Node method*/
086: throw new Error("not implemented: getAttributes()");
087: }
088:
089: public NodeList getChildNodes() {
090: /**@todo: Implement this org.w3c.dom.Node method*/
091: throw new Error("not implemented: getChildNodes()");
092: }
093:
094: public Node getFirstChild() {
095: return null;
096: }
097:
098: public Node getLastChild() {
099: /**@todo: Implement this org.w3c.dom.Node method*/
100: throw new Error("not implemented: getLastChild()");
101: }
102:
103: /** Always return null */
104: public String getLocalName() {
105: return null;
106: }
107:
108: /** Always return null */
109: public String getNamespaceURI() {
110: return null;
111: }
112:
113: public String getNodeName() {
114: return "#text";
115: }
116:
117: public short getNodeType() {
118: return Node.TEXT_NODE;
119: }
120:
121: public String getNodeValue() throws org.w3c.dom.DOMException {
122: return getSpartanText().getData();
123: }
124:
125: public org.w3c.dom.Node getParentNode() {
126: if (getSpartan().getParentNode() == null)
127: return null;
128: else {
129: com.rimfaxe.xml.xmlreader.Element spartanParent = getSpartan()
130: .getParentNode();
131: return ((DocumentImpl) getOwnerDocument())
132: .wrapper(spartanParent);
133: }
134:
135: }
136:
137: public String getPrefix() {
138: /**@todo: Implement this org.w3c.dom.Node method*/
139: throw new Error("not implemented: getPrefix()");
140: }
141:
142: public boolean hasAttributes() {
143: /**@todo: Implement this org.w3c.dom.Node method*/
144: throw new Error("not implemented: hasAttributes()");
145: }
146:
147: /** ALways returns false. */
148: public boolean hasChildNodes() {
149: return false;
150: }
151:
152: public Node insertBefore(Node parm1, Node parm2)
153: throws org.w3c.dom.DOMException {
154: /**@todo: Implement this org.w3c.dom.Node method*/
155: throw new Error("not implemented: insertBefore()");
156: }
157:
158: public boolean isSupported(String feature, String version) {
159: if (feature
160: .equals("http://xml.apache.org/xpath/features/whitespace-pre-stripping"))
161: return false;
162: else if (feature
163: .equals("http://xml.apache.org/xalan/features/feed-events"))
164: return false;
165: else if (feature.equals("NodeTestFilter"))
166: return false;
167: throw new Error("Method isSupported(" + feature + "," + version
168: + ") not known.");
169: }
170:
171: public void normalize() {
172: /**@todo: Implement this org.w3c.dom.Node method*/
173: throw new Error("not implemented: normalize()");
174: }
175:
176: public Node removeChild(Node parm1) throws org.w3c.dom.DOMException {
177: /**@todo: Implement this org.w3c.dom.Node method*/
178: throw new Error("not implemented: removeChild()");
179: }
180:
181: public Node replaceChild(Node parm1, Node parm2)
182: throws org.w3c.dom.DOMException {
183: /**@todo: Implement this org.w3c.dom.Node method*/
184: throw new Error("not implemented: replaceChild()");
185: }
186:
187: public void setNodeValue(String data)
188: throws org.w3c.dom.DOMException {
189: getSpartanText().setData(data);
190: }
191:
192: public void setPrefix(String parm1) throws org.w3c.dom.DOMException {
193: /**@todo: Implement this org.w3c.dom.Node method*/
194: throw new Error("not implemented: setPrefix()");
195: }
196:
197: ////////////////////////////////////////////////////
198: // BEGIN DOM 3
199:
200: public boolean getIsWhitespaceInElementContent() {
201: /**@todo: Implement this org.w3c.dom.Node method*/
202: throw new Error("not implemented: setPrefix()");
203: }
204:
205: public String getWholeText() {
206: /**@todo: Implement this org.w3c.dom.Node method*/
207: throw new Error("not implemented: setPrefix()");
208: }
209:
210: public Text replaceWholeText(String content)
211: throws org.w3c.dom.DOMException {
212: /**@todo: Implement this org.w3c.dom.Node method*/
213: throw new Error("not implemented: setPrefix()");
214: }
215:
216: // END DOM 3
217: ////////////////////////////////////////////////////
218:
219: com.rimfaxe.xml.xmlreader.Text getSpartanText() {
220: return (com.rimfaxe.xml.xmlreader.Text) getSpartan();
221: }
222:
223: TextImpl(DocumentImpl doc, com.rimfaxe.xml.xmlreader.Text spartan) {
224: super (doc, spartan);
225: }
226:
227: }
228:
229: // $Log: TextImpl.java,v $
230: // Revision 1.3 2002/11/06 02:59:55 eobrain
231: // Organize imputs to removed unused imports. Remove some unused local variables.
232: //
233: // Revision 1.2 2002/08/21 20:19:10 eobrain
234: // Also implement CDATASection.
235: //
236: // Revision 1.1.1.1 2002/08/19 05:04:13 eobrain
237: // import from HP Labs internal CVS
238: //
239: // Revision 1.6 2002/08/18 05:46:24 eob
240: // Add copyright and other formatting and commenting in preparation for
241: // release to SourceForge.
242: //
243: // Revision 1.5 2002/06/21 00:34:49 eob
244: // Make work with old JDK 1.1.*
245: //
246: // Revision 1.4 2002/05/02 23:01:50 eob
247: // Handle test fot NodeTestFilter feature.
248: //
249: // Revision 1.3 2002/02/23 01:44:56 eob
250: // Implement some methods that had just been stubs.
251: //
252: // Revision 1.2 2002/02/08 20:34:04 eob
253: // Added extra DOM3 stuff.
254: //
255: // Revision 1.1 2002/01/05 07:40:08 eob
256: // initial
|