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.DOMException;
25 import org.w3c.dom.Text;
26
27 /***
28 * ProxyTextNodeAdapter is a pass-through adapter for objects which already
29 * implement the Text interface. All methods are proxied to the underlying
30 * Node except getParent(), getNextSibling() and getPreviousSibling(), which
31 * are implemented by the abstract adapter node to work with the parent adapter.
32 */
33 public class ProxyTextNodeAdapter extends ProxyNodeAdapter implements Text {
34
35 public ProxyTextNodeAdapter(AdapterFactory factory, AdapterNode parent, Text value) {
36 super(factory, parent, value);
37 }
38
39
40 Text text() {
41 return (Text) getPropertyValue();
42 }
43
44 public String toString() {
45 return "ProxyTextNode for: " + text();
46 }
47
48 public Text splitText(int offset) throws DOMException {
49 throw new UnsupportedOperationException();
50 }
51
52 public int getLength() {
53 return text().getLength();
54 }
55
56 public void deleteData(int offset, int count) throws DOMException {
57 throw new UnsupportedOperationException();
58 }
59
60 public String getData() throws DOMException {
61 return text().getData();
62 }
63
64 public String substringData(int offset, int count) throws DOMException {
65 return text().substringData(offset, count);
66 }
67
68 public void replaceData(int offset, int count, String arg) throws DOMException {
69 throw new UnsupportedOperationException();
70 }
71
72 public void insertData(int offset, String arg) throws DOMException {
73 throw new UnsupportedOperationException();
74 }
75
76 public void appendData(String arg) throws DOMException {
77 throw new UnsupportedOperationException();
78 }
79
80 public void setData(String data) throws DOMException {
81 throw new UnsupportedOperationException();
82 }
83
84
85
86 public boolean isElementContentWhitespace() {
87 throw operationNotSupported();
88 }
89
90 public String getWholeText() {
91 throw operationNotSupported();
92 }
93
94 public Text replaceWholeText(String string) throws DOMException {
95 throw operationNotSupported();
96 }
97 }
98