KickJava   Java API By Example, From Geeks To Geeks.

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


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;
20
21 import java.io.IOException JavaDoc;
22
23 // JDOM imports
24
import org.jdom.Document;
25
26 // SAX imports
27
import org.xml.sax.EntityResolver JavaDoc;
28
29 /**
30  * <p>
31  * <code>Source</code> provides an interface for all input
32  * means. It details the required contract that other
33  * portions of the Zeus XML data binding framework must
34  * use for processing of an arbitrary input.
35  * </p>
36  * <p>
37  * All input sources should implement this interface, and
38  * be named <code>XXXSource</code> where <i>XXX</i> reflects the
39  * type of input handled. For example, input from I/O
40  * streams is handled by
41  * <code>{@link org.enhydra.zeus.source.StreamSource}</code>.
42  * </p>
43  *
44  * @author Brett McLaughlin
45  */

46 public interface Source {
47
48     /**
49      * <p>
50      * This will return the system ID associated with
51      * this <code>Source</code>. This is generally in
52      * the form of a URI.
53      * </p>
54      *
55      * @return <code>String</code> - the system ID for the
56      * <code>Source</code>.
57      */

58     public String JavaDoc getSystemID();
59     
60     /**
61      * <p>
62      * This will set the system ID for this
63      * <code>Source</code>. This is important to use,
64      * even when input is in the form of an input stream
65      * (see
66      * <code>{@link org.enhydra.zeus.source.StreamSource}</code>)
67      * for resolving external references, such as to a DTD.
68      * </p>
69      *
70      * @param systemID <code>String</code> system ID to use.
71      */

72     public void setSystemID(String JavaDoc systemID);
73     
74     /**
75      * <p>
76      * This will return a JDOM <code>Document</code> that
77      * represents the input source.
78      * </p>
79      *
80      * @return <code>Document</code> - the JDOM representation
81      * of the input source.
82      * @throws <code>IOException</code> - when construction of
83      * a <code>Document</code> generates errors.
84      */

85     public Document getDocument() throws IOException JavaDoc;
86
87     /**
88      * <p>
89      * This will set an <code>EntityResolver</code> for this
90      * <code>Source</code>. This is passed to the underlying
91      * parser to use.
92      * </p>
93      *
94      * @param entityResolver <code>EntityResolver</code> to use
95      * during parsing.
96      */

97     public void setEntityResolver(EntityResolver JavaDoc entityResolver);
98 }
99
Popular Tags