001: /*
002: * @(#)DOMCharacterDataImpl.java 1.11 2000/08/16
003: *
004: */
005:
006: package org.w3c.tidy;
007:
008: import org.w3c.dom.DOMException;
009:
010: /**
011: *
012: * DOMCharacterDataImpl
013: *
014: * (c) 1998-2000 (W3C) MIT, INRIA, Keio University
015: * See Tidy.java for the copyright notice.
016: * Derived from <a href="http://www.w3.org/People/Raggett/tidy">
017: * HTML Tidy Release 4 Aug 2000</a>
018: *
019: * @author Dave Raggett <dsr@w3.org>
020: * @author Andy Quick <ac.quick@sympatico.ca> (translation to Java)
021: * @version 1.7, 1999/12/06 Tidy Release 30 Nov 1999
022: * @version 1.8, 2000/01/22 Tidy Release 13 Jan 2000
023: * @version 1.9, 2000/06/03 Tidy Release 30 Apr 2000
024: * @version 1.10, 2000/07/22 Tidy Release 8 Jul 2000
025: * @version 1.11, 2000/08/16 Tidy Release 4 Aug 2000
026: */
027:
028: public class DOMCharacterDataImpl extends DOMNodeImpl implements
029: org.w3c.dom.CharacterData {
030:
031: protected DOMCharacterDataImpl(Node adaptee) {
032: super (adaptee);
033: }
034:
035: /* --------------------- DOM ---------------------------- */
036:
037: /**
038: * @see org.w3c.dom.CharacterData#getData
039: */
040: public String getData() throws DOMException {
041: return getNodeValue();
042: }
043:
044: /**
045: * @see org.w3c.dom.CharacterData#setData
046: */
047: public void setData(String data) throws DOMException {
048: // NOT SUPPORTED
049: throw new DOMExceptionImpl(
050: DOMException.NO_MODIFICATION_ALLOWED_ERR,
051: "Not supported");
052: }
053:
054: /**
055: * @see org.w3c.dom.CharacterData#getLength
056: */
057: public int getLength() {
058: int len = 0;
059: if (adaptee.textarray != null && adaptee.start < adaptee.end)
060: len = adaptee.end - adaptee.start;
061: return len;
062: }
063:
064: /**
065: * @see org.w3c.dom.CharacterData#substringData
066: */
067: public String substringData(int offset, int count)
068: throws DOMException {
069: int len;
070: String value = null;
071: if (count < 0) {
072: throw new DOMExceptionImpl(DOMException.INDEX_SIZE_ERR,
073: "Invalid length");
074: }
075: if (adaptee.textarray != null && adaptee.start < adaptee.end) {
076: if (adaptee.start + offset >= adaptee.end) {
077: throw new DOMExceptionImpl(DOMException.INDEX_SIZE_ERR,
078: "Invalid offset");
079: }
080: len = count;
081: if (adaptee.start + offset + len - 1 >= adaptee.end)
082: len = adaptee.end - adaptee.start - offset;
083:
084: value = Lexer.getString(adaptee.textarray, adaptee.start
085: + offset, len);
086: }
087: return value;
088: }
089:
090: /**
091: * @see org.w3c.dom.CharacterData#appendData
092: */
093: public void appendData(String arg) throws DOMException {
094: // NOT SUPPORTED
095: throw new DOMExceptionImpl(
096: DOMException.NO_MODIFICATION_ALLOWED_ERR,
097: "Not supported");
098: }
099:
100: /**
101: * @see org.w3c.dom.CharacterData#insertData
102: */
103: public void insertData(int offset, String arg) throws DOMException {
104: // NOT SUPPORTED
105: throw new DOMExceptionImpl(
106: DOMException.NO_MODIFICATION_ALLOWED_ERR,
107: "Not supported");
108: }
109:
110: /**
111: * @see org.w3c.dom.CharacterData#deleteData
112: */
113: public void deleteData(int offset, int count) throws DOMException {
114: // NOT SUPPORTED
115: throw new DOMExceptionImpl(
116: DOMException.NO_MODIFICATION_ALLOWED_ERR,
117: "Not supported");
118: }
119:
120: /**
121: * @see org.w3c.dom.CharacterData#replaceData
122: */
123: public void replaceData(int offset, int count, String arg)
124: throws DOMException {
125: // NOT SUPPORTED
126: throw new DOMExceptionImpl(
127: DOMException.NO_MODIFICATION_ALLOWED_ERR,
128: "Not supported");
129: }
130:
131: public org.w3c.dom.Node adoptNode(org.w3c.dom.Node oNode) {
132: throw new UnsupportedOperationException(
133: "org.w3c.tidy.DOMCharacterDataImpl adoptNode() Not implemented");
134: }
135:
136: public short compareDocumentPosition(org.w3c.dom.Node oNode) {
137: throw new UnsupportedOperationException(
138: "org.w3c.tidy.DOMCharacterDataImpl compareDocumentPosition() Not implemented");
139: }
140:
141: public boolean isDefaultNamespace(String sStr1) {
142: throw new UnsupportedOperationException(
143: "org.w3c.tidy.DOMCharacterDataImpl isDefaultNamespace() Not implemented");
144: }
145:
146: public boolean isEqualNode(org.w3c.dom.Node oNode) {
147: throw new UnsupportedOperationException(
148: "org.w3c.tidy.DOMCharacterDataImpl isEqualNode() Not implemented");
149: }
150:
151: public boolean isSameNode(org.w3c.dom.Node oNode) {
152: throw new UnsupportedOperationException(
153: "org.w3c.tidy.DOMCharacterDataImpl isSameNode() Not implemented");
154: }
155:
156: public String lookupPrefix(String sStr1) {
157: throw new UnsupportedOperationException(
158: "org.w3c.tidy.DOMCharacterDataImpl lookupPreffix() Not implemented");
159: }
160:
161: public String lookupNamespaceURI(String sStr1) {
162: throw new UnsupportedOperationException(
163: "org.w3c.tidy.DOMCharacterDataImpl lookupNamespaceURI() Not implemented");
164: }
165:
166: public String getDocumentURI() {
167: throw new UnsupportedOperationException(
168: "org.w3c.tidy.DOMCharacterDataImpl getDocumentURI() Not implemented");
169: }
170:
171: public void setDocumentURI(String sStr1) {
172: throw new UnsupportedOperationException(
173: "org.w3c.tidy.DOMCharacterDataImpl setDocumentURI() Not implemented");
174: }
175:
176: public boolean getStrictErrorChecking() {
177: throw new UnsupportedOperationException(
178: "org.w3c.tidy.DOMCharacterDataImpl getStrictErrorChecking() Not implemented");
179: }
180:
181: public void setStrictErrorChecking(boolean bStrictCheck) {
182: throw new UnsupportedOperationException(
183: "org.w3c.tidy.DOMCharacterDataImpl setStrictErrorChecking() Not implemented");
184: }
185:
186: public boolean getXmlStandalone() {
187: throw new UnsupportedOperationException(
188: "org.w3c.tidy.DOMCharacterDataImpl getXmlStandalone() Not implemented");
189: }
190:
191: public void setXmlStandalone(boolean bXmlStandalone) {
192: throw new UnsupportedOperationException(
193: "org.w3c.tidy.DOMCharacterDataImpl setXmlStandalone() Not implemented");
194: }
195:
196: public Object getFeature(String sStr1, String sStr2) {
197: throw new UnsupportedOperationException(
198: "org.w3c.tidy.DOMCharacterDataImpl getFeature() Not implemented");
199: }
200:
201: public String getInputEncoding() {
202: throw new UnsupportedOperationException(
203: "org.w3c.tidy.DOMCharacterDataImpl getInputEncoding() Not implemented");
204: }
205:
206: public String getXmlEncoding() {
207: throw new UnsupportedOperationException(
208: "org.w3c.tidy.DOMCharacterDataImpl getXmlEncoding() Not implemented");
209: }
210:
211: public String getXmlVersion() {
212: throw new UnsupportedOperationException(
213: "org.w3c.tidy.DOMCharacterDataImpl getXmlVersion() Not implemented");
214: }
215:
216: public void setXmlVersion(String sStr1) {
217: throw new UnsupportedOperationException(
218: "org.w3c.tidy.DOMCharacterDataImpl setXmlVersion() Not implemented");
219: }
220:
221: public Object getUserData(String sStr1) {
222: throw new UnsupportedOperationException(
223: "org.w3c.tidy.DOMCharacterDataImpl getUserData() Not implemented");
224: }
225:
226: public Object setUserData(String sStr1, Object oObj2,
227: org.w3c.dom.UserDataHandler oHndlr) {
228: throw new UnsupportedOperationException(
229: "org.w3c.tidy.DOMCharacterDataImpl setUserData() Not implemented");
230: }
231:
232: public org.w3c.dom.DOMConfiguration getDomConfig() {
233: throw new UnsupportedOperationException(
234: "org.w3c.tidy.DOMCharacterDataImpl getDomConfig() Not implemented");
235: }
236:
237: public void normalizeDocument() {
238: throw new UnsupportedOperationException(
239: "org.w3c.tidy.DOMCharacterDataImpl normalizeDocument() Not implemented");
240: }
241:
242: public org.w3c.dom.Node renameNode(org.w3c.dom.Node oNode,
243: String sStr1, String sStr2) {
244: throw new UnsupportedOperationException(
245: "org.w3c.tidy.DOMCharacterDataImpl renameNode() Not implemented");
246: }
247:
248: public String getBaseURI() {
249: throw new UnsupportedOperationException(
250: "org.w3c.tidy.DOMCharacterDataImpl getBaseURI() Not implemented");
251: }
252:
253: public String getTextContent() {
254: throw new UnsupportedOperationException(
255: "org.w3c.tidy.DOMCharacterDataImpl getTextContent() Not implemented");
256: }
257:
258: public void setTextContent(String sStr1) {
259: throw new UnsupportedOperationException(
260: "org.w3c.tidy.DOMCharacterDataImpl setTextContent() Not implemented");
261: }
262:
263: }
|