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