1 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 42 public abstract class ProxyDocumentFactory { 43 private DocumentFactory proxy; 44 45 public ProxyDocumentFactory() { 46 this.proxy = DocumentFactory.getInstance(); 48 } 49 50 public ProxyDocumentFactory(DocumentFactory proxy) { 51 this.proxy = proxy; 52 } 53 54 public Document createDocument() { 57 return proxy.createDocument(); 58 } 59 60 public Document createDocument(Element rootElement) { 61 return proxy.createDocument(rootElement); 62 } 63 64 public DocumentType createDocType(String name, String publicId, 65 String systemId) { 66 return proxy.createDocType(name, publicId, systemId); 67 } 68 69 public Element createElement(QName qname) { 70 return proxy.createElement(qname); 71 } 72 73 public Element createElement(String name) { 74 return proxy.createElement(name); 75 } 76 77 public Attribute createAttribute(Element owner, QName qname, String value) { 78 return proxy.createAttribute(owner, qname, value); 79 } 80 81 public Attribute createAttribute(Element owner, String name, String value) { 82 return proxy.createAttribute(owner, name, value); 83 } 84 85 public CDATA createCDATA(String text) { 86 return proxy.createCDATA(text); 87 } 88 89 public Comment createComment(String text) { 90 return proxy.createComment(text); 91 } 92 93 public Text createText(String text) { 94 return proxy.createText(text); 95 } 96 97 public Entity createEntity(String name, String text) { 98 return proxy.createEntity(name, text); 99 } 100 101 public Namespace createNamespace(String prefix, String uri) { 102 return proxy.createNamespace(prefix, uri); 103 } 104 105 public ProcessingInstruction createProcessingInstruction(String target, 106 String data) { 107 return proxy.createProcessingInstruction(target, data); 108 } 109 110 public ProcessingInstruction createProcessingInstruction(String target, 111 Map data) { 112 return proxy.createProcessingInstruction(target, data); 113 } 114 115 public QName createQName(String localName, Namespace namespace) { 116 return proxy.createQName(localName, namespace); 117 } 118 119 public QName createQName(String localName) { 120 return proxy.createQName(localName); 121 } 122 123 public QName createQName(String name, String prefix, String uri) { 124 return proxy.createQName(name, prefix, uri); 125 } 126 127 public QName createQName(String qualifiedName, String uri) { 128 return proxy.createQName(qualifiedName, uri); 129 } 130 131 public XPath createXPath(String xpathExpression) { 132 return proxy.createXPath(xpathExpression); 133 } 134 135 public XPath createXPath(String xpathExpression, 136 VariableContext variableContext) { 137 return proxy.createXPath(xpathExpression, variableContext); 138 } 139 140 public NodeFilter createXPathFilter(String xpathFilterExpression, 141 VariableContext variableContext) { 142 return proxy.createXPathFilter(xpathFilterExpression, variableContext); 143 } 144 145 public NodeFilter createXPathFilter(String xpathFilterExpression) { 146 return proxy.createXPathFilter(xpathFilterExpression); 147 } 148 149 public Pattern createPattern(String xpathPattern) { 150 return proxy.createPattern(xpathPattern); 151 } 152 153 protected DocumentFactory getProxy() { 156 return proxy; 157 } 158 159 protected void setProxy(DocumentFactory proxy) { 160 if (proxy == null) { 161 proxy = DocumentFactory.getInstance(); 163 } 164 165 this.proxy = proxy; 166 } 167 } 168 169 205 | Popular Tags |