1 50 51 package org.openlaszlo.iv.flash.xml.jaxen; 52 53 import org.openlaszlo.iv.flash.context.Context; 54 import org.openlaszlo.iv.flash.context.XMLContext; 55 import org.openlaszlo.iv.flash.xml.XMLFactory; 56 import org.openlaszlo.iv.flash.xml.XPathProcessor; 57 import javax.xml.parsers.DocumentBuilder ; 58 import javax.xml.parsers.DocumentBuilderFactory ; 59 import javax.xml.parsers.ParserConfigurationException ; 60 import org.w3c.dom.Node ; 61 62 70 public class XMLFactoryImpl extends XMLFactory { 71 72 private DocumentBuilderFactory factory; 73 private XPathProcessor xpathProcessor; 74 75 public XMLFactoryImpl(DocumentBuilderFactory factory) throws ParserConfigurationException { 76 this.factory = factory; 77 } 78 79 public DocumentBuilder getDocumentBuilder() throws ParserConfigurationException { 80 return factory.newDocumentBuilder(); 81 } 82 83 public XMLContext newXMLContext(Context parent, Node node) { 84 return new XMLContextImpl(parent, node); 85 } 86 87 public XPathProcessor getXPathProcessor() { 88 if (xpathProcessor == null) 89 xpathProcessor = new XPathProcessorImpl(); 90 return xpathProcessor; 91 } 92 } 93 | Popular Tags |