1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 package org.apache.struts2.views.xslt;
19
20 import org.w3c.dom.Attr;
21 import org.w3c.dom.DOMException;
22 import org.w3c.dom.Element;
23 import org.w3c.dom.TypeInfo;
24
25 /***
26 * ProxyAttrAdapter is a pass-through adapter for objects which already
27 * implement the Attr interface. All methods are proxied to the underlying
28 * Node except node traversal (e.g. getParent()) related methods which
29 * are implemented by the abstract adapter node to work with the parent adapter.
30 */
31 public class ProxyAttrAdapter extends ProxyNodeAdapter implements Attr {
32
33 public ProxyAttrAdapter(AdapterFactory factory, AdapterNode parent, Attr value) {
34 super(factory, parent, value);
35 }
36
37
38 protected Attr attr() {
39 return (Attr) getPropertyValue();
40 }
41
42
43
44 public String getName() {
45 return attr().getName();
46 }
47
48 public boolean getSpecified() {
49 return attr().getSpecified();
50 }
51
52 public String getValue() {
53 return attr().getValue();
54 }
55
56 public void setValue(String string) throws DOMException {
57 throw new UnsupportedOperationException();
58 }
59
60 public Element getOwnerElement() {
61 return (Element) getParent();
62 }
63
64
65
66 public TypeInfo getSchemaTypeInfo() {
67 throw operationNotSupported();
68 }
69
70 public boolean isId() {
71 throw operationNotSupported();
72 }
73
74
75
76
77
78 public String toString() {
79 return "ProxyAttribute for: " + attr();
80 }
81 }
82