1 6 7 package org.dom4j.tree; 8 9 import org.dom4j.*; 10 import org.dom4j.rule.Pattern; 11 import org.jaxen.VariableContext; 12 13 import java.util.Map ; 14 15 19 public class DelegateDocumentFactory extends DocumentFactory { 20 21 private NodeFactory nodeFactory; 22 private XPathFactory xpathFactory; 23 24 25 public DelegateDocumentFactory(NodeFactory nodeFactory, XPathFactory xpathFactory) { 26 super(); 27 28 this.nodeFactory = nodeFactory; 29 this.xpathFactory = xpathFactory; 30 } 31 32 public Attribute createAttribute(Element owner, String name, String value) { 33 return nodeFactory.createAttribute(owner, name, value); 34 } 35 36 public Attribute createAttribute(Element owner, QName qname, String value) { 37 return nodeFactory.createAttribute(owner, qname, value); 38 } 39 40 public CDATA createCDATA(String text) { 41 return nodeFactory.createCDATA(text); 42 } 43 44 public Comment createComment(String text) { 45 return nodeFactory.createComment(text); 46 } 47 48 public DocumentType createDocType(String name, String publicId, String systemId) { 49 return nodeFactory.createDocType(name, publicId, systemId); 50 } 51 52 public Document createDocument() { 53 return nodeFactory.createDocument(); 54 } 55 56 public Document createDocument(Element rootElement) { 57 return nodeFactory.createDocument(rootElement); 58 } 59 60 public Element createElement(QName qname) { 61 return nodeFactory.createElement(qname); 62 } 63 64 public Element createElement(String name) { 65 return nodeFactory.createElement(name); 66 } 67 68 public Element createElement(String qualifiedName, String namespaceURI) { 69 return nodeFactory.createElement(qualifiedName, namespaceURI); 70 } 71 72 public Entity createEntity(String name, String text) { 73 return nodeFactory.createEntity(name, text); 74 } 75 76 public Namespace createNamespace(String prefix, String uri) { 77 return nodeFactory.createNamespace(prefix, uri); 78 } 79 80 public Pattern createPattern(String xpathPattern) { 81 return xpathFactory.createPattern(xpathPattern); 82 } 83 84 public ProcessingInstruction createProcessingInstruction(String target, Map data) { 85 return nodeFactory.createProcessingInstruction(target, data); 86 } 87 88 public ProcessingInstruction createProcessingInstruction(String target, String data) { 89 return nodeFactory.createProcessingInstruction(target, data); 90 } 91 92 public QName createQName(String localName) { 93 return nodeFactory.createQName(localName); 94 } 95 96 public QName createQName(String qualifiedName, String uri) { 97 return nodeFactory.createQName(qualifiedName, uri); 98 } 99 100 public QName createQName(String localName, Namespace namespace) { 101 return nodeFactory.createQName(localName, namespace); 102 } 103 104 public QName createQName(String name, String prefix, String uri) { 105 return nodeFactory.createQName(name, prefix, uri); 106 } 107 108 public Text createText(String text) { 109 return nodeFactory.createText(text); 110 } 111 112 public XPath createXPath(String xpathExpression) throws InvalidXPathException { 113 return xpathFactory.createXPath(xpathExpression); 114 } 115 116 public XPath createXPath(String xpathExpression, VariableContext variableContext) { 117 return xpathFactory.createXPath(xpathExpression, variableContext); 118 } 119 120 public NodeFilter createXPathFilter(String xpathFilterExpression) { 121 return xpathFactory.createXPathFilter(xpathFilterExpression); 122 } 123 124 public NodeFilter createXPathFilter(String xpathFilterExpression, VariableContext variableContext) { 125 return xpathFactory.createXPathFilter(xpathFilterExpression, variableContext); 126 } 127 128 } 129 | Popular Tags |