KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > icl > saxon > sql > SQLElementFactory


1 package com.icl.saxon.sql;
2 import com.icl.saxon.style.ExtensionElementFactory;
3 import org.xml.sax.SAXException JavaDoc;
4
5 /**
6   * Class SQLElementFactory. <br>
7   * A "Factory" for SQL extension nodes in the stylesheet tree. <br>
8   */

9
10 public class SQLElementFactory implements ExtensionElementFactory {
11
12     /**
13     * Identify the class to be used for stylesheet elements with a given local name.
14     * The returned class must extend com.icl.saxon.style.StyleElement
15     * @return null if the local name is not a recognised element type in this
16     * namespace.
17     */

18
19     public Class JavaDoc getExtensionClass(String JavaDoc localname) {
20         if (localname.equals("connect")) return SQLConnect.class;
21         if (localname.equals("insert")) return SQLInsert.class;
22         if (localname.equals("column")) return SQLColumn.class;
23         if (localname.equals("close")) return SQLClose.class;
24         return null;
25     }
26
27 }
28
29 //
30
// The contents of this file are subject to the Mozilla Public License Version 1.0 (the "License");
31
// you may not use this file except in compliance with the License. You may obtain a copy of the
32
// License at http://www.mozilla.org/MPL/
33
//
34
// Software distributed under the License is distributed on an "AS IS" basis,
35
// WITHOUT WARRANTY OF ANY KIND, either express or implied.
36
// See the License for the specific language governing rights and limitations under the License.
37
//
38
// The Original Code is: all this file.
39
//
40
// The Initial Developer of the Original Code is
41
// Michael Kay of International Computers Limited (mhkay@iclway.co.uk).
42
//
43
// Portions created by (your name) are Copyright (C) (your legal entity). All Rights Reserved.
44
//
45
// Contributor(s): none.
46
//
47
Popular Tags