KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > net > sf > saxon > sql > SQLElementFactory


1 package net.sf.saxon.sql;
2 import net.sf.saxon.style.ExtensionElementFactory;
3
4 /**
5   * Class SQLElementFactory. <br>
6   * A "Factory" for SQL extension nodes in the stylesheet tree. <br>
7   */

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

17
18     public Class JavaDoc getExtensionClass(String JavaDoc localname) {
19         if (localname.equals("connect")) return SQLConnect.class;
20         if (localname.equals("insert")) return SQLInsert.class;
21         if (localname.equals("column")) return SQLColumn.class;
22         if (localname.equals("close")) return SQLClose.class;
23         if (localname.equals("query")) return SQLQuery.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 Michael H. Kay.
41
//
42
// Portions created by (your name) are Copyright (C) (your legal entity). All Rights Reserved.
43
//
44
// Contributor(s): none.
45
//
46
Popular Tags