KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > enhydra > wireless > chtml > CHTMLDomFactory


1 /*
2  * Enhydra Java Application Server Project
3  *
4  * The contents of this file are subject to the Enhydra Public License
5  * Version 1.1 (the "License"); you may not use this file except in
6  * compliance with the License. You may obtain a copy of the License on
7  * the Enhydra web site ( http://www.enhydra.org/ ).
8  *
9  * Software distributed under the License is distributed on an "AS IS"
10  * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
11  * the License for the specific terms governing rights and limitations
12  * under the License.
13  *
14  * The Initial Developer of the Original Code is DigitalSesame
15  * Portions created by DigitalSesame are Copyright (C) 1997-2000 DigitalSesame
16  * All Rights Reserved.
17  *
18  * Contributor(s):
19  *
20  * $Id: CHTMLDomFactory.java,v 1.2 2005/01/26 08:28:45 jkjome Exp $
21  */

22
23 package org.enhydra.wireless.chtml;
24
25 import org.enhydra.wireless.chtml.dom.CHTMLDocument;
26 import org.enhydra.wireless.chtml.dom.xerces.CHTMLDocumentImpl;
27 import org.enhydra.xml.xmlc.dom.XMLCDomFactory;
28 import org.enhydra.xml.xmlc.dom.xerces.XercesHTMLDomFactory;
29 import org.w3c.dom.Document JavaDoc;
30 import org.w3c.dom.DocumentType JavaDoc;
31 import org.w3c.dom.Node JavaDoc;
32
33 /**
34  * XMLC DOM factory for XHTML.
35  * @see XMLCDomFactory
36  */

37 public class CHTMLDomFactory extends XercesHTMLDomFactory implements XMLCDomFactory {
38     /**
39      * @see XMLCDomFactory#createDocument
40      */

41     public Document createDocument(String JavaDoc namespaceURI,
42                                    String JavaDoc qualifiedName,
43                                    DocumentType JavaDoc docType) {
44     return new CHTMLDocumentImpl();
45     }
46     /**
47      * @see XMLCDomFactory#nodeClassToInterface
48      */

49     public String JavaDoc nodeClassToInterface(Node JavaDoc node) {
50         if (node instanceof CHTMLDocument) {
51             return CHTMLDocument.class.getName();
52         } else {
53             return super.nodeClassToInterface(node);
54         }
55     }
56 }
57
Popular Tags