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