KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > nwalsh > saxon > TextFactory


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 JavaDoc;
7
8 /**
9  * <p>Saxon extension element factory
10  *
11  * <p>$Id: TextFactory.java,v 1.1 2001/07/16 21:23:57 nwalsh 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 2001/07/16 21:23:57 nwalsh 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 JavaDoc getExtensionClass(String JavaDoc localname) {
53     if (localname.equals("insertfile")) {
54       try {
55     return Class.forName("com.nwalsh.saxon.Text");
56       } catch (ClassNotFoundException JavaDoc e) {
57     return null;
58       }
59     }
60     return null;
61   }
62 }
63
64
65
66
67
68
Popular Tags