KickJava   Java API By Example, From Geeks To Geeks.

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


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.result;
20
21 import java.io.IOException JavaDoc;
22
23 // Zeus imports
24
import org.enhydra.zeus.Result;
25
26 /**
27  * <p>
28  * <code>{@link Result}</code> provides an interface for all output
29  * means. It details the required contract that other
30  * portions of the Zeus XML data binding framework must
31  * use for processing to an arbitrary output.
32  * </p>
33  * <p>
34  * This implementation of <code>Result</code> handles the
35  * basic functionality of dealing with system IDs so that
36  * other implementations don't have to code these methods.
37  * Thus, <code>XXXResult</code> classes should extend
38  * this class, rather than directly implementing
39  * <code>Result</code>, and will get this functionality
40  * "for free."
41  * </p>
42  *
43  * @author Brett McLaughlin
44  */

45 public abstract class BaseResult implements Result {
46
47     /** The system ID for this <code>Result</code> */
48     protected String JavaDoc systemID;
49     
50     /**
51      * <p>
52      * This will return the system ID associated with
53      * this <code>Result</code>. This is generally in
54      * the form of a URI.
55      * </p>
56      *
57      * @return <code>String</code> - the system ID for the
58      * <code>Result</code>.
59      */

60     public String JavaDoc getSystemID() {
61         return systemID;
62     }
63     
64     /**
65      * <p>
66      * This will set the system ID for this
67      * <code>Result</code>. This is important to use,
68      * even when output is in the form of an output stream
69      * (see <code>{@link StreamResult}</code>)
70      * for resolving external references, such as to a DTD.
71      * </p>
72      *
73      * @param systemID <code>String</code> system ID to use.
74      */

75     public void setSystemID(String JavaDoc systemID) {
76         this.systemID = systemID;
77     }
78     
79     /**
80      * <p>
81      * This will write a character stream to the output
82      * facility associated with this <code>Result</code>.
83      * No additional formatting is added, so line feeds,
84      * tabs, or other special characters should be handled
85      * by the code performing output.
86      * </p>
87      *
88      * @param output <code>String</code> to output.
89      * @throws <code>IOException</code> - when errors in output occur.
90      */

91     public abstract void write(String JavaDoc output) throws IOException JavaDoc;
92
93 }
94
Popular Tags