2 * @(#)DOMCharacterDataImpl.java 1.11 2000/08/16
6 package net.sourceforge.phpdt.tidy.w3c;
8 import org.w3c.dom.DOMException;
12 * DOMCharacterDataImpl
14 * (c) 1998-2000 (W3C) MIT, INRIA, Keio University
15 * See Tidy.java for the copyright notice.
16 * Derived from <a href="http://www.w3.org/People/Raggett/tidy">
17 * HTML Tidy Release 4 Aug 2000</a>
19 * @author Dave Raggett <dsr@w3.org>
20 * @author Andy Quick <ac.quick@sympatico.ca> (translation to Java)
21 * @version 1.7, 1999/12/06 Tidy Release 30 Nov 1999
22 * @version 1.8, 2000/01/22 Tidy Release 13 Jan 2000
23 * @version 1.9, 2000/06/03 Tidy Release 30 Apr 2000
24 * @version 1.10, 2000/07/22 Tidy Release 8 Jul 2000
25 * @version 1.11, 2000/08/16 Tidy Release 4 Aug 2000
28 public class DOMCharacterDataImpl extends DOMNodeImpl
29 implements org.w3c.dom.CharacterData {
31 protected DOMCharacterDataImpl(Node adaptee)
37 /* --------------------- DOM ---------------------------- */
40 * @see org.w3c.dom.CharacterData#getData
42 public String getData() throws DOMException
44 return getNodeValue();
48 * @see org.w3c.dom.CharacterData#setData
50 public void setData(String data) throws DOMException
53 throw new DOMExceptionImpl(DOMException.NO_MODIFICATION_ALLOWED_ERR,
58 * @see org.w3c.dom.CharacterData#getLength
60 public int getLength()
63 if (adaptee.textarray != null && adaptee.start < adaptee.end)
64 len = adaptee.end - adaptee.start;
69 * @see org.w3c.dom.CharacterData#substringData
71 public String substringData(int offset,
72 int count) throws DOMException
78 throw new DOMExceptionImpl(DOMException.INDEX_SIZE_ERR,
81 if (adaptee.textarray != null && adaptee.start < adaptee.end)
83 if (adaptee.start + offset >= adaptee.end)
85 throw new DOMExceptionImpl(DOMException.INDEX_SIZE_ERR,
89 if (adaptee.start + offset + len - 1 >= adaptee.end)
90 len = adaptee.end - adaptee.start - offset;
92 value = Lexer.getString(adaptee.textarray,
93 adaptee.start + offset,
100 * @see org.w3c.dom.CharacterData#appendData
102 public void appendData(String arg) throws DOMException
105 throw new DOMExceptionImpl(DOMException.NO_MODIFICATION_ALLOWED_ERR,
110 * @see org.w3c.dom.CharacterData#insertData
112 public void insertData(int offset,
113 String arg) throws DOMException
116 throw new DOMExceptionImpl(DOMException.NO_MODIFICATION_ALLOWED_ERR,
121 * @see org.w3c.dom.CharacterData#deleteData
123 public void deleteData(int offset,
124 int count) throws DOMException
127 throw new DOMExceptionImpl(DOMException.NO_MODIFICATION_ALLOWED_ERR,
132 * @see org.w3c.dom.CharacterData#replaceData
134 public void replaceData(int offset,
136 String arg) throws DOMException
139 throw new DOMExceptionImpl(DOMException.NO_MODIFICATION_ALLOWED_ERR,