1 package org.xmldb.common.xml.queries; 2 54 55 import javax.xml.parsers.FactoryConfigurationError ; 56 57 58 63 public abstract class XPathQueryFactory { 64 65 public static final String FACTORY_KEY = "org.xmldb.common.xml.queries.XPathQueryFactory"; 66 67 public XPathQueryFactory() { 68 } 69 70 71 public static XPathQueryFactory newInstance() { 72 String factoryName = System.getProperty(FACTORY_KEY, 74 "org.xmldb.common.xml.queries.xalan.XPathQueryFactoryImpl"); 75 76 XPathQueryFactory factory = null; 77 78 try { 79 Class clazz = Class.forName(factoryName); 80 factory = (XPathQueryFactory) clazz.newInstance(); 81 } catch (ClassNotFoundException cnfe) { 82 throw new FactoryConfigurationError (cnfe); 83 } catch (IllegalAccessException iae) { 84 throw new FactoryConfigurationError (iae); 85 } catch (InstantiationException ie) { 86 throw new FactoryConfigurationError (ie); 87 } 88 return factory; 89 } 90 91 92 public abstract XPathQuery newXPathQuery() throws XPathQueryConfigurationException; 93 94 } 95 | Popular Tags |