01: // TextFactory - Saxon extension element factory
02:
03: package com.nwalsh.saxon;
04:
05: import com.icl.saxon.style.ExtensionElementFactory;
06: import org.xml.sax.SAXException;
07:
08: /**
09: * <p>Saxon extension element factory
10: *
11: * <p>$Id: TextFactory.java,v 1.1 2006/05/31 17:21:20 mbatchelor Exp $</p>
12: *
13: * <p>Copyright (C) 2000 Norman Walsh.</p>
14: *
15: * <p>This class provides a
16: * <a href="http://users.iclway.co.uk/mhkay/saxon/">Saxon</a>
17: * extension element factory for the Text extension element
18: * family.</p>
19: *
20: * <p><b>Change Log:</b></p>
21: * <dl>
22: * <dt>1.0</dt>
23: * <dd><p>Initial release.</p></dd>
24: * </dl>
25: *
26: * @author Norman Walsh
27: * <a href="mailto:ndw@nwalsh.com">ndw@nwalsh.com</a>
28: *
29: * @version $Id: TextFactory.java,v 1.1 2006/05/31 17:21:20 mbatchelor Exp $
30: *
31: * @see Text
32: *
33: */
34: public class TextFactory implements ExtensionElementFactory {
35: /**
36: * <p>Constructor for TextFactory</p>
37: *
38: * <p>Does nothing.</p>
39: */
40: public TextFactory() {
41: }
42:
43: /**
44: * <p>Return the class that implements a particular extension element.</p>
45: *
46: * @param localname The local name of the extension element.
47: *
48: * @return The class that handles that extension element.
49: *
50: * @exception SAXException("Unknown Text extension element")
51: */
52: public Class getExtensionClass(String localname) {
53: if (localname.equals("insertfile")) {
54: try {
55: return Class.forName("com.nwalsh.saxon.Text");
56: } catch (ClassNotFoundException e) {
57: return null;
58: }
59: }
60: return null;
61: }
62: }
|