KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > enhydra > xml > xmlc > dom > lazydom > LazyHTMLDomFactory


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 Enhydra Application Server is Lutris
15  * Technologies, Inc. The Enhydra Application Server and portions created
16  * by Lutris Technologies, Inc. are Copyright Lutris Technologies, Inc.
17  * All Rights Reserved.
18  *
19  * Contributor(s):
20  *
21  * $Id: LazyHTMLDomFactory.java,v 1.2 2005/01/26 08:29:24 jkjome Exp $
22  */

23
24 package org.enhydra.xml.xmlc.dom.lazydom;
25
26 import org.enhydra.xml.lazydom.TemplateDOM;
27 import org.enhydra.xml.lazydom.html.LazyHTMLDocument;
28 import org.enhydra.xml.xmlc.dom.HTMLDomFactoryMethods;
29 import org.enhydra.xml.xmlc.dom.XMLCDomFactory;
30 import org.w3c.dom.Document JavaDoc;
31 import org.w3c.dom.DocumentType JavaDoc;
32 import org.w3c.dom.Element JavaDoc;
33
34 /**
35  * Lazy DOM factory for creating HTML Document objects.
36  */

37 public class LazyHTMLDomFactory extends LazyDomFactory
38     implements XMLCDomFactory {
39
40     /**
41      * @see XMLCDomFactory#createDocument
42      */

43     public Document createDocument(String JavaDoc namespaceURI,
44                                    String JavaDoc qualifiedName,
45                                    DocumentType JavaDoc docType) {
46         LazyHTMLDocument doc = new LazyHTMLDocument(null);
47         // This creates the document element.
48
doc.getDocumentElement();
49         return doc;
50     }
51
52     /**
53      * Create a LazyDocument from a template.
54      * @see XMLCDomFactory#createDocument
55      */

56     public Document createDocument(TemplateDOM templateDOM) {
57         return new LazyHTMLDocument(templateDOM);
58     }
59
60     /**
61      * @see XMLCDomFactory#getMIMEType
62      */

63     public String JavaDoc getMIMEType() {
64         return "text/html";
65     }
66
67     /**
68      * @see XMLCDomFactory#getBaseClassName
69      */

70     public String JavaDoc getBaseClassName() {
71         return HTMLDomFactoryMethods.getBaseClassName();
72     }
73
74     /**
75      * @see XMLCDomFactory#getInterfaceNames
76      */

77     public String JavaDoc[] getInterfaceNames() {
78         return HTMLDomFactoryMethods.getInterfaceNames();
79     }
80
81     /**
82      * @see XMLCDomFactory#getElementClassNames
83      */

84     public String JavaDoc[] getElementClassNames(Element JavaDoc element) {
85         return HTMLDomFactoryMethods.getElementClassNames(element);
86     }
87
88     /**
89      * @see XMLCDomFactory#isURLAttribute
90      */

91     public boolean isURLAttribute(Element JavaDoc element,
92                                   String JavaDoc attrName) {
93         return HTMLDomFactoryMethods.isURLAttribute(element, attrName);
94     }
95 }
96
Popular Tags