01: // You can redistribute this software and/or modify it under the terms of
02: // the Infozone Software License version 2 published by the Infozone Group
03: // (http://www.infozone-group.org).
04: //
05: // Copyright (C) @year@ by The Infozone Group. All rights reserved.
06: //
07: // $Id: XPathQueryFactory.java,v 1.1 2002/05/10 08:59:12 per_nyfelt Exp $
08:
09: package org.infozone.tools.xml.queries;
10:
11: import javax.xml.parsers.FactoryConfigurationError;
12:
13: /**
14: * @version $Revision: 1.1 $ $Date: 2002/05/10 08:59:12 $
15: * @author <a href="http://www.softwarebuero.de">SMB</a>
16: * @see XPathQuery
17: */
18: public abstract class XPathQueryFactory {
19:
20: public XPathQueryFactory() {
21: }
22:
23: public static XPathQueryFactory newInstance() {
24: String factoryName = System
25: .getProperty(
26: "org.infozone.tools.xml.queries.XPathQueryFactory",
27: "org.infozone.tools.xml.queries.xalan.XPathQueryFactoryImpl");
28:
29: XPathQueryFactory factory = null;
30:
31: try {
32: Class clazz = Class.forName(factoryName);
33: factory = (XPathQueryFactory) clazz.newInstance();
34: } catch (ClassNotFoundException cnfe) {
35: throw new FactoryConfigurationError(cnfe);
36: } catch (IllegalAccessException iae) {
37: throw new FactoryConfigurationError(iae);
38: } catch (InstantiationException ie) {
39: throw new FactoryConfigurationError(ie);
40: }
41: return factory;
42: }
43:
44: public abstract XPathQuery newXPathQuery()
45: throws XPathQueryConfigurationException;
46:
47: }
|