001: /*
002: * @(#)DOMAttrImpl.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: * DOMAttrImpl
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.4, 1999/09/04 DOM Support
022: * @version 1.5, 1999/10/23 Tidy Release 27 Sep 1999
023: * @version 1.6, 1999/11/01 Tidy Release 22 Oct 1999
024: * @version 1.7, 1999/12/06 Tidy Release 30 Nov 1999
025: * @version 1.8, 2000/01/22 Tidy Release 13 Jan 2000
026: * @version 1.9, 2000/06/03 Tidy Release 30 Apr 2000
027: * @version 1.10, 2000/07/22 Tidy Release 8 Jul 2000
028: * @version 1.11, 2000/08/16 Tidy Release 4 Aug 2000
029: */
030:
031: public class DOMAttrImpl extends DOMNodeImpl implements
032: org.w3c.dom.Attr {
033:
034: protected AttVal avAdaptee;
035:
036: protected DOMAttrImpl(AttVal adaptee) {
037: super (null); // must override all methods of DOMNodeImpl
038: this .avAdaptee = adaptee;
039: }
040:
041: /* --------------------- DOM ---------------------------- */
042:
043: public String getNodeValue() throws DOMException {
044: return getValue();
045: }
046:
047: public void setNodeValue(String nodeValue) throws DOMException {
048: setValue(nodeValue);
049: }
050:
051: public String getNodeName() {
052: return getName();
053: }
054:
055: public short getNodeType() {
056: return org.w3c.dom.Node.ATTRIBUTE_NODE;
057: }
058:
059: public org.w3c.dom.Node getParentNode() {
060: return null;
061: }
062:
063: public org.w3c.dom.NodeList getChildNodes() {
064: // NOT SUPPORTED
065: return null;
066: }
067:
068: public org.w3c.dom.Node getFirstChild() {
069: // NOT SUPPORTED
070: return null;
071: }
072:
073: public org.w3c.dom.Node getLastChild() {
074: // NOT SUPPORTED
075: return null;
076: }
077:
078: public org.w3c.dom.Node getPreviousSibling() {
079: return null;
080: }
081:
082: public org.w3c.dom.Node getNextSibling() {
083: return null;
084: }
085:
086: public org.w3c.dom.NamedNodeMap getAttributes() {
087: return null;
088: }
089:
090: public org.w3c.dom.Document getOwnerDocument() {
091: return null;
092: }
093:
094: public org.w3c.dom.Node insertBefore(org.w3c.dom.Node newChild,
095: org.w3c.dom.Node refChild) throws DOMException {
096: throw new DOMExceptionImpl(
097: DOMException.NO_MODIFICATION_ALLOWED_ERR,
098: "Not supported");
099: }
100:
101: public org.w3c.dom.Node replaceChild(org.w3c.dom.Node newChild,
102: org.w3c.dom.Node oldChild) throws DOMException {
103: throw new DOMExceptionImpl(
104: DOMException.NO_MODIFICATION_ALLOWED_ERR,
105: "Not supported");
106: }
107:
108: public org.w3c.dom.Node removeChild(org.w3c.dom.Node oldChild)
109: throws DOMException {
110: throw new DOMExceptionImpl(
111: DOMException.NO_MODIFICATION_ALLOWED_ERR,
112: "Not supported");
113: }
114:
115: public org.w3c.dom.Node appendChild(org.w3c.dom.Node newChild)
116: throws DOMException {
117: throw new DOMExceptionImpl(
118: DOMException.NO_MODIFICATION_ALLOWED_ERR,
119: "Not supported");
120: }
121:
122: public boolean hasChildNodes() {
123: return false;
124: }
125:
126: public org.w3c.dom.Node cloneNode(boolean deep) {
127: return null;
128: }
129:
130: /**
131: * @see org.w3c.dom.Attr#getName
132: */
133: public String getName() {
134: return avAdaptee.attribute;
135: }
136:
137: /**
138: * @see org.w3c.dom.Attr#getSpecified
139: */
140: public boolean getSpecified() {
141: return true;
142: }
143:
144: /**
145: * Returns value of this attribute. If this attribute has a null value,
146: * then the attribute name is returned instead.
147: * Thanks to Brett Knights <brett@knightsofthenet.com> for this fix.
148: * @see org.w3c.dom.Attr#getValue
149: *
150: */
151: public String getValue() {
152: return (avAdaptee.value == null) ? avAdaptee.attribute
153: : avAdaptee.value;
154: }
155:
156: /**
157: * @see org.w3c.dom.Attr#setValue
158: */
159: public void setValue(String value) {
160: avAdaptee.value = value;
161: }
162:
163: /**
164: * DOM2 - not implemented.
165: */
166: public org.w3c.dom.Element getOwnerElement() {
167: return null;
168: }
169:
170: public boolean isId() {
171: throw new UnsupportedOperationException(
172: "org.w3c.tidy.DOMAttrImpl isId() Not implemented");
173: }
174:
175: public org.w3c.dom.TypeInfo getSchemaTypeInfo() {
176: throw new UnsupportedOperationException(
177: "org.w3c.tidy.DOMAttrImpl getSchemaTypeInfo() Not implemented");
178: }
179:
180: public org.w3c.dom.Node adoptNode(org.w3c.dom.Node oNode) {
181: throw new UnsupportedOperationException(
182: "org.w3c.tidy.DOMAttrImpl adoptNode() Not implemented");
183: }
184:
185: public short compareDocumentPosition(org.w3c.dom.Node oNode) {
186: throw new UnsupportedOperationException(
187: "org.w3c.tidy.DOMAttrImpl compareDocumentPosition() Not implemented");
188: }
189:
190: public boolean isDefaultNamespace(String sStr1) {
191: throw new UnsupportedOperationException(
192: "org.w3c.tidy.DOMAttrImpl isDefaultNamespace() Not implemented");
193: }
194:
195: public boolean isEqualNode(org.w3c.dom.Node oNode) {
196: throw new UnsupportedOperationException(
197: "org.w3c.tidy.DOMAttrImpl isEqualNode() Not implemented");
198: }
199:
200: public boolean isSameNode(org.w3c.dom.Node oNode) {
201: throw new UnsupportedOperationException(
202: "org.w3c.tidy.DOMAttrImpl isSameNode() Not implemented");
203: }
204:
205: public String lookupPrefix(String sStr1) {
206: throw new UnsupportedOperationException(
207: "org.w3c.tidy.DOMAttrImpl lookupPreffix() Not implemented");
208: }
209:
210: public String lookupNamespaceURI(String sStr1) {
211: throw new UnsupportedOperationException(
212: "org.w3c.tidy.DOMAttrImpl lookupNamespaceURI() Not implemented");
213: }
214:
215: public String getDocumentURI() {
216: throw new UnsupportedOperationException(
217: "org.w3c.tidy.DOMAttrImpl getDocumentURI() Not implemented");
218: }
219:
220: public void setDocumentURI(String sStr1) {
221: throw new UnsupportedOperationException(
222: "org.w3c.tidy.DOMAttrImpl setDocumentURI() Not implemented");
223: }
224:
225: public boolean getStrictErrorChecking() {
226: throw new UnsupportedOperationException(
227: "org.w3c.tidy.DOMAttrImpl getStrictErrorChecking() Not implemented");
228: }
229:
230: public void setStrictErrorChecking(boolean bStrictCheck) {
231: throw new UnsupportedOperationException(
232: "org.w3c.tidy.DOMAttrImpl setStrictErrorChecking() Not implemented");
233: }
234:
235: public boolean getXmlStandalone() {
236: throw new UnsupportedOperationException(
237: "org.w3c.tidy.DOMAttrImpl getXmlStandalone() Not implemented");
238: }
239:
240: public void setXmlStandalone(boolean bXmlStandalone) {
241: throw new UnsupportedOperationException(
242: "org.w3c.tidy.DOMAttrImpl setXmlStandalone() Not implemented");
243: }
244:
245: public Object getFeature(String sStr1, String sStr2) {
246: throw new UnsupportedOperationException(
247: "org.w3c.tidy.DOMAttrImpl getFeature() Not implemented");
248: }
249:
250: public String getInputEncoding() {
251: throw new UnsupportedOperationException(
252: "org.w3c.tidy.DOMAttrImpl getInputEncoding() Not implemented");
253: }
254:
255: public String getXmlEncoding() {
256: throw new UnsupportedOperationException(
257: "org.w3c.tidy.DOMAttrImpl getXmlEncoding() Not implemented");
258: }
259:
260: public String getXmlVersion() {
261: throw new UnsupportedOperationException(
262: "org.w3c.tidy.DOMAttrImpl getXmlVersion() Not implemented");
263: }
264:
265: public void setXmlVersion(String sStr1) {
266: throw new UnsupportedOperationException(
267: "org.w3c.tidy.DOMAttrImpl setXmlVersion() Not implemented");
268: }
269:
270: public Object getUserData(String sStr1) {
271: throw new UnsupportedOperationException(
272: "org.w3c.tidy.DOMAttrImpl getUserData() Not implemented");
273: }
274:
275: public Object setUserData(String sStr1, Object oObj2,
276: org.w3c.dom.UserDataHandler oHndlr) {
277: throw new UnsupportedOperationException(
278: "org.w3c.tidy.DOMAttrImpl setUserData() Not implemented");
279: }
280:
281: public org.w3c.dom.DOMConfiguration getDomConfig() {
282: throw new UnsupportedOperationException(
283: "org.w3c.tidy.DOMAttrImpl getDomConfig() Not implemented");
284: }
285:
286: public void normalizeDocument() {
287: throw new UnsupportedOperationException(
288: "org.w3c.tidy.DOMAttrImpl normalizeDocument() Not implemented");
289: }
290:
291: public org.w3c.dom.Node renameNode(org.w3c.dom.Node oNode,
292: String sStr1, String sStr2) {
293: throw new UnsupportedOperationException(
294: "org.w3c.tidy.DOMAttrImpl renameNode() Not implemented");
295: }
296:
297: public String getBaseURI() {
298: throw new UnsupportedOperationException(
299: "org.w3c.tidy.DOMAttrImpl getBaseURI() Not implemented");
300: }
301:
302: public String getTextContent() {
303: throw new UnsupportedOperationException(
304: "org.w3c.tidy.DOMAttrImpl getTextContent() Not implemented");
305: }
306:
307: public void setTextContent(String sStr1) {
308: throw new UnsupportedOperationException(
309: "org.w3c.tidy.DOMAttrImpl setTextContent() Not implemented");
310: }
311:
312: }
|