01: // Copyright (c) 2004 Per M.A. Bothner.
02: // This is free software; for terms and warranty disclaimer see ./COPYING.
03:
04: package gnu.kawa.xml;
05:
06: import gnu.xml.*;
07:
08: /* #ifdef use:org.w3c.dom.Node */
09: // import org.w3c.dom.*;
10: /* #endif */
11:
12: public class KAttr extends KNode
13: /* #ifdef use:org.w3c.dom.Node */
14: // implements org.w3c.dom.Attr
15: /* #endif */
16: {
17: public KAttr(NodeTree seq, int ipos) {
18: super (seq, ipos);
19: }
20:
21: public String getName() {
22: return sequence.getNextTypeName(ipos);
23: }
24:
25: /* #ifdef use:org.w3c.dom.Node */
26: // public short getNodeType () { return Node.ATTRIBUTE_NODE; }
27: /* #endif */
28:
29: public String getValue() {
30: return getNodeValue();
31: }
32:
33: public static Object getObjectValue(NodeTree sequence, int ipos) {
34: return sequence.getPosNext(ipos + 10);
35: }
36:
37: /** Get attribute value as (typed) Object, rather than string. */
38: public Object getObjectValue() {
39: return getObjectValue((NodeTree) sequence, ipos);
40: }
41:
42: /* #ifdef use:org.w3c.dom.Node */
43: // public void setValue (String value)
44: // throws DOMException
45: // {
46: // throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR,
47: // "setValue not supported");
48: // }
49: // public Node getParentNode()
50: // {
51: // return null;
52: // }
53: // public Element getOwnerElement ()
54: // {
55: // return (Element) super.getParentNode();
56: // }
57: /* #endif */
58:
59: public boolean getSpecified() {
60: return true;
61: }
62:
63: /* #ifdef JAXP-1.3 */
64: // public TypeInfo getSchemaTypeInfo ()
65: // {
66: // return null;
67: // }
68: // public boolean isId ()
69: // {
70: // return false;
71: // }
72: /* #endif JAXP-1.3 */
73: }
|