KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > gnu > kawa > xml > KAttr


1 // Copyright (c) 2004 Per M.A. Bothner.
2
// This is free software; for terms and warranty disclaimer see ./COPYING.
3

4 package gnu.kawa.xml;
5 import gnu.xml.*;
6 /* #ifdef use:org.w3c.dom.Node */
7 // import org.w3c.dom.*;
8
/* #endif */
9
10 public class KAttr extends KNode
11   /* #ifdef use:org.w3c.dom.Node */
12   // implements org.w3c.dom.Attr
13
/* #endif */
14 {
15   public KAttr (NodeTree seq, int ipos)
16   {
17     super(seq, ipos);
18   }
19  
20   public String JavaDoc getName ()
21   {
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 JavaDoc getValue ()
30   {
31     return getNodeValue();
32   }
33
34   public static Object JavaDoc getObjectValue (NodeTree sequence, int ipos)
35   {
36     return sequence.getPosNext(ipos+10);
37   }
38
39   /** Get attribute value as (typed) Object, rather than string. */
40   public Object JavaDoc getObjectValue ()
41   {
42     return getObjectValue((NodeTree) sequence, ipos);
43   }
44
45   /* #ifdef use:org.w3c.dom.Node */
46   // public void setValue (String value)
47
// throws DOMException
48
// {
49
// throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR,
50
// "setValue not supported");
51
// }
52

53   // public Node getParentNode()
54
// {
55
// return null;
56
// }
57

58   // public Element getOwnerElement ()
59
// {
60
// return (Element) super.getParentNode();
61
// }
62
/* #endif */
63
64   public boolean getSpecified ()
65   {
66     return true;
67   }
68
69   /* #ifdef JAXP-1.3 */
70   // public TypeInfo getSchemaTypeInfo ()
71
// {
72
// return null;
73
// }
74

75   // public boolean isId ()
76
// {
77
// return false;
78
// }
79
/* #endif JAXP-1.3 */
80 }
81
Popular Tags