|
1 |
| |
|
2 |
| |
|
3 |
| |
|
4 |
| |
|
5 |
| |
|
6 |
| |
|
7 |
| |
|
8 |
| package org.dom4j.util; |
|
9 |
| |
|
10 |
| import java.util.Map; |
|
11 |
| |
|
12 |
| import org.dom4j.Attribute; |
|
13 |
| import org.dom4j.CDATA; |
|
14 |
| import org.dom4j.Comment; |
|
15 |
| import org.dom4j.Document; |
|
16 |
| import org.dom4j.DocumentFactory; |
|
17 |
| import org.dom4j.DocumentType; |
|
18 |
| import org.dom4j.Element; |
|
19 |
| import org.dom4j.Entity; |
|
20 |
| import org.dom4j.Namespace; |
|
21 |
| import org.dom4j.NodeFilter; |
|
22 |
| import org.dom4j.ProcessingInstruction; |
|
23 |
| import org.dom4j.QName; |
|
24 |
| import org.dom4j.Text; |
|
25 |
| import org.dom4j.XPath; |
|
26 |
| import org.dom4j.rule.Pattern; |
|
27 |
| |
|
28 |
| import org.jaxen.VariableContext; |
|
29 |
| |
|
30 |
| |
|
31 |
| |
|
32 |
| |
|
33 |
| |
|
34 |
| |
|
35 |
| |
|
36 |
| |
|
37 |
| |
|
38 |
| |
|
39 |
| |
|
40 |
| |
|
41 |
| |
|
42 |
| public abstract class ProxyDocumentFactory { |
|
43 |
| private DocumentFactory proxy; |
|
44 |
| |
|
45 |
0
| public ProxyDocumentFactory() {
|
|
46 |
| |
|
47 |
0
| this.proxy = DocumentFactory.getInstance();
|
|
48 |
| } |
|
49 |
| |
|
50 |
0
| public ProxyDocumentFactory(DocumentFactory proxy) {
|
|
51 |
0
| this.proxy = proxy;
|
|
52 |
| } |
|
53 |
| |
|
54 |
| |
|
55 |
| |
|
56 |
0
| public Document createDocument() {
|
|
57 |
0
| return proxy.createDocument();
|
|
58 |
| } |
|
59 |
| |
|
60 |
0
| public Document createDocument(Element rootElement) {
|
|
61 |
0
| return proxy.createDocument(rootElement);
|
|
62 |
| } |
|
63 |
| |
|
64 |
0
| public DocumentType createDocType(String name, String publicId,
|
|
65 |
| String systemId) { |
|
66 |
0
| return proxy.createDocType(name, publicId, systemId);
|
|
67 |
| } |
|
68 |
| |
|
69 |
0
| public Element createElement(QName qname) {
|
|
70 |
0
| return proxy.createElement(qname);
|
|
71 |
| } |
|
72 |
| |
|
73 |
0
| public Element createElement(String name) {
|
|
74 |
0
| return proxy.createElement(name);
|
|
75 |
| } |
|
76 |
| |
|
77 |
0
| public Attribute createAttribute(Element owner, QName qname, String value) {
|
|
78 |
0
| return proxy.createAttribute(owner, qname, value);
|
|
79 |
| } |
|
80 |
| |
|
81 |
0
| public Attribute createAttribute(Element owner, String name, String value) {
|
|
82 |
0
| return proxy.createAttribute(owner, name, value);
|
|
83 |
| } |
|
84 |
| |
|
85 |
0
| public CDATA createCDATA(String text) {
|
|
86 |
0
| return proxy.createCDATA(text);
|
|
87 |
| } |
|
88 |
| |
|
89 |
0
| public Comment createComment(String text) {
|
|
90 |
0
| return proxy.createComment(text);
|
|
91 |
| } |
|
92 |
| |
|
93 |
0
| public Text createText(String text) {
|
|
94 |
0
| return proxy.createText(text);
|
|
95 |
| } |
|
96 |
| |
|
97 |
0
| public Entity createEntity(String name, String text) {
|
|
98 |
0
| return proxy.createEntity(name, text);
|
|
99 |
| } |
|
100 |
| |
|
101 |
0
| public Namespace createNamespace(String prefix, String uri) {
|
|
102 |
0
| return proxy.createNamespace(prefix, uri);
|
|
103 |
| } |
|
104 |
| |
|
105 |
0
| public ProcessingInstruction createProcessingInstruction(String target,
|
|
106 |
| String data) { |
|
107 |
0
| return proxy.createProcessingInstruction(target, data);
|
|
108 |
| } |
|
109 |
| |
|
110 |
0
| public ProcessingInstruction createProcessingInstruction(String target,
|
|
111 |
| Map data) { |
|
112 |
0
| return proxy.createProcessingInstruction(target, data);
|
|
113 |
| } |
|
114 |
| |
|
115 |
0
| public QName createQName(String localName, Namespace namespace) {
|
|
116 |
0
| return proxy.createQName(localName, namespace);
|
|
117 |
| } |
|
118 |
| |
|
119 |
0
| public QName createQName(String localName) {
|
|
120 |
0
| return proxy.createQName(localName);
|
|
121 |
| } |
|
122 |
| |
|
123 |
0
| public QName createQName(String name, String prefix, String uri) {
|
|
124 |
0
| return proxy.createQName(name, prefix, uri);
|
|
125 |
| } |
|
126 |
| |
|
127 |
0
| public QName createQName(String qualifiedName, String uri) {
|
|
128 |
0
| return proxy.createQName(qualifiedName, uri);
|
|
129 |
| } |
|
130 |
| |
|
131 |
0
| public XPath createXPath(String xpathExpression) {
|
|
132 |
0
| return proxy.createXPath(xpathExpression);
|
|
133 |
| } |
|
134 |
| |
|
135 |
0
| public XPath createXPath(String xpathExpression,
|
|
136 |
| VariableContext variableContext) { |
|
137 |
0
| return proxy.createXPath(xpathExpression, variableContext);
|
|
138 |
| } |
|
139 |
| |
|
140 |
0
| public NodeFilter createXPathFilter(String xpathFilterExpression,
|
|
141 |
| VariableContext variableContext) { |
|
142 |
0
| return proxy.createXPathFilter(xpathFilterExpression, variableContext);
|
|
143 |
| } |
|
144 |
| |
|
145 |
0
| public NodeFilter createXPathFilter(String xpathFilterExpression) {
|
|
146 |
0
| return proxy.createXPathFilter(xpathFilterExpression);
|
|
147 |
| } |
|
148 |
| |
|
149 |
0
| public Pattern createPattern(String xpathPattern) {
|
|
150 |
0
| return proxy.createPattern(xpathPattern);
|
|
151 |
| } |
|
152 |
| |
|
153 |
| |
|
154 |
| |
|
155 |
0
| protected DocumentFactory getProxy() {
|
|
156 |
0
| return proxy;
|
|
157 |
| } |
|
158 |
| |
|
159 |
0
| protected void setProxy(DocumentFactory proxy) {
|
|
160 |
0
| if (proxy == null) {
|
|
161 |
| |
|
162 |
0
| proxy = DocumentFactory.getInstance();
|
|
163 |
| } |
|
164 |
| |
|
165 |
0
| this.proxy = proxy;
|
|
166 |
| } |
|
167 |
| } |
|
168 |
| |
|
169 |
| |
|
170 |
| |
|
171 |
| |
|
172 |
| |
|
173 |
| |
|
174 |
| |
|
175 |
| |
|
176 |
| |
|
177 |
| |
|
178 |
| |
|
179 |
| |
|
180 |
| |
|
181 |
| |
|
182 |
| |
|
183 |
| |
|
184 |
| |
|
185 |
| |
|
186 |
| |
|
187 |
| |
|
188 |
| |
|
189 |
| |
|
190 |
| |
|
191 |
| |
|
192 |
| |
|
193 |
| |
|
194 |
| |
|
195 |
| |
|
196 |
| |
|
197 |
| |
|
198 |
| |
|
199 |
| |
|
200 |
| |
|
201 |
| |
|
202 |
| |
|
203 |
| |
|
204 |
| |