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