2 * @(#)DOMAttrImpl.java 1.11 2000/08/16
8 import org.w3c.dom.DOMException;
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.4, 1999/09/04 DOM Support
22 * @version 1.5, 1999/10/23 Tidy Release 27 Sep 1999
23 * @version 1.6, 1999/11/01 Tidy Release 22 Oct 1999
24 * @version 1.7, 1999/12/06 Tidy Release 30 Nov 1999
25 * @version 1.8, 2000/01/22 Tidy Release 13 Jan 2000
26 * @version 1.9, 2000/06/03 Tidy Release 30 Apr 2000
27 * @version 1.10, 2000/07/22 Tidy Release 8 Jul 2000
28 * @version 1.11, 2000/08/16 Tidy Release 4 Aug 2000
31 public class DOMAttrImpl extends DOMNodeImpl implements org.w3c.dom.Attr {
33 protected AttVal avAdaptee;
35 protected DOMAttrImpl(AttVal adaptee)
37 super(null); // must override all methods of DOMNodeImpl
38 this.avAdaptee = adaptee;
42 /* --------------------- DOM ---------------------------- */
44 public String getNodeValue() throws DOMException
49 public void setNodeValue(String nodeValue) throws DOMException
54 public String getNodeName()
59 public short getNodeType()
61 return org.w3c.dom.Node.ATTRIBUTE_NODE;
64 public org.w3c.dom.Node getParentNode()
69 public org.w3c.dom.NodeList getChildNodes()
75 public org.w3c.dom.Node getFirstChild()
81 public org.w3c.dom.Node getLastChild()
87 public org.w3c.dom.Node getPreviousSibling()
92 public org.w3c.dom.Node getNextSibling()
97 public org.w3c.dom.NamedNodeMap getAttributes()
102 public org.w3c.dom.Document getOwnerDocument()
107 public org.w3c.dom.Node insertBefore(org.w3c.dom.Node newChild,
108 org.w3c.dom.Node refChild)
111 throw new DOMExceptionImpl(DOMException.NO_MODIFICATION_ALLOWED_ERR,
115 public org.w3c.dom.Node replaceChild(org.w3c.dom.Node newChild,
116 org.w3c.dom.Node oldChild)
119 throw new DOMExceptionImpl(DOMException.NO_MODIFICATION_ALLOWED_ERR,
123 public org.w3c.dom.Node removeChild(org.w3c.dom.Node oldChild)
126 throw new DOMExceptionImpl(DOMException.NO_MODIFICATION_ALLOWED_ERR,
130 public org.w3c.dom.Node appendChild(org.w3c.dom.Node newChild)
133 throw new DOMExceptionImpl(DOMException.NO_MODIFICATION_ALLOWED_ERR,
137 public boolean hasChildNodes()
142 public org.w3c.dom.Node cloneNode(boolean deep)
148 * @see org.w3c.dom.Attr#getName
150 public String getName()
152 return avAdaptee.attribute;
156 * @see org.w3c.dom.Attr#getSpecified
158 public boolean getSpecified()
164 * Returns value of this attribute. If this attribute has a null value,
165 * then the attribute name is returned instead.
166 * Thanks to Brett Knights <brett@knightsofthenet.com> for this fix.
167 * @see org.w3c.dom.Attr#getValue
170 public String getValue()
172 return (avAdaptee.value == null) ? avAdaptee.attribute : avAdaptee.value ;
176 * @see org.w3c.dom.Attr#setValue
178 public void setValue(String value)
180 avAdaptee.value = value;
184 * DOM2 - not implemented.
186 public org.w3c.dom.Element getOwnerElement() {