KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > enhydra > zeus > source > DTDSource


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 package org.enhydra.zeus.source;
20
21 import java.io.IOException JavaDoc;
22
23 // Zeus imports
24
import org.enhydra.zeus.Source;
25
26 // JDOM imports
27
import org.jdom.Document;
28
29 // DTDParser imports
30
import com.wutka.dtd.DTD;
31
32 /**
33  * <p>
34  * <code>{@link Source}</code> provides an interface for all input
35  * means. It details the required contract that other
36  * portions of the Zeus XML data binding framework must
37  * use for processing of an arbitrary input.
38  * </p>
39  * <p>
40  * <code>DTDSource</code> extends the default <code>Source</code> implementation
41  * in <code>{@link BaseSource}</code>, but provides functionality
42  * specific to obtaining DTD information. Since all other XML constraint
43  * methodologies involve constraints that are themselves well-formed
44  * XML, handling DTDs is a special case, and therefore needs a special
45  * class (this one!).
46  * </p><p>
47  * It should be noted that this class will <b>always</b> return
48  * <code>null</code> on the method <code>{@link #getDocument()}</code>.
49  * Instead, it adds a method, <code>{@link #getDTD()}</code>, for
50  * returning a Java representation of an XML DTD.
51  * </p>
52  *
53  * @author Brett McLaughlin
54  */

55 public abstract class DTDSource extends BaseSource {
56     
57     /**
58      * <p>
59      * This will <b>always</b> return <code>null</code>
60      * since there is no way to represent an XML DTD
61      * as a JDOM <code>Document</code> (or any XML
62      * document representation).
63      * </p>
64      *
65      * @return <code>Document</code> - the JDOM representation
66      * of the input source.
67      * @throws <code>IOException</code> - when construction of
68      * a <code>Document</code> generates errors.
69      */

70     public Document getDocument() throws IOException JavaDoc {
71         return null;
72     }
73     
74     /**
75      * <p>
76      * This will return the <code>DTDParser</code>'s
77      * <code>DTD</code> representation of the supplied
78      * XML DTD.
79      * </p>
80      *
81      * @return <code>DTD</code> - the <code>DTDParser</code>
82      * representation of the input source.
83      * @throws <code>IOException</code> - when construction of
84      * a <code>DTD</code> generates errors.
85      */

86     public abstract DTD getDTD() throws IOException JavaDoc;
87
88 }
89
Popular Tags