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