KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > util > cmdline > api > Console


1 /*====================================================================
2
3 ObjectWeb Util CommandLine Package.
4 Copyright (C) 2003 INRIA & USTL - LIFL - GOAL
5 Contact: architecture@objectweb.org
6
7 This library is free software; you can redistribute it and/or
8 modify it under the terms of the GNU Lesser General Public
9 License as published by the Free Software Foundation; either
10 version 2.1 of the License, or any later version.
11
12 This library is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 Lesser General Public License for more details.
16
17 You should have received a copy of the GNU Lesser General Public
18 License along with this library; if not, write to the Free Software
19 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
20 USA
21
22 Initial developer(s): Philippe Merle.
23 Contributor(s): ______________________________________.
24
25 ====================================================================*/

26
27 package org.objectweb.util.cmdline.api;
28
29 // Package dependencies.
30
import java.io.PrintStream JavaDoc;
31
32 /**
33  * This interface wraps standard output and error streams.
34  *
35  * This provides the following properties:
36  *
37  * - OutputStream: The standard output stream.
38  *
39  * - ErrorStream: The standard error stream.
40  *
41  * - MessageHeader: The header printed before messages.
42  *
43  * - SilentMessage: Flag to indicate if messages will be really printed or not.
44  *
45  * This provides the following methods:
46  *
47  * - message: Prints messages to the standard output stream.
48  *
49  * - error: Prints messages to the standard error stream.
50  *
51  * @author <a HREF="mailto:Philippe.Merle@lifl.fr">Philippe Merle</a>
52  *
53  * @version 0.1
54  */

55
56 public interface Console
57 {
58     /**
59      * Gets the standard output stream.
60      *
61      * @return The standard output stream.
62      */

63     public PrintStream JavaDoc
64     getOutputStream();
65
66     /**
67      * Sets the standard output stream.
68      *
69      * @param output The standard output stream.
70      */

71     public void
72     setOutputStream(PrintStream JavaDoc output);
73
74     /**
75      * Gets the standard error stream.
76      *
77      * @return The standard error stream.
78      */

79     public PrintStream JavaDoc
80     getErrorStream();
81
82     /**
83      * Sets the standard error stream.
84      *
85      * @param error The standard error stream.
86      */

87     public void
88     setErrorStream(PrintStream JavaDoc error);
89
90     /**
91      * Gets the message header.
92      *
93      * @return The message header.
94      */

95     public String JavaDoc
96     getMessageHeader();
97
98     /**
99      * Sets the message header.
100      *
101      * @param header The message header.
102      */

103     public void
104     setMessageHeader(String JavaDoc header);
105
106     /**
107      * Gets the silent flag status.
108      *
109      * @return The silent flag status.
110      */

111     public boolean
112     getSilentMessage();
113
114     /**
115      * Sets the silent flag status.
116      *
117      * @param flag The silent flag status.
118      */

119     public void
120     setSilentMessage(boolean flag);
121
122     /**
123      * Prints a message on the standard output.
124      *
125      * @param text The message to print.
126      */

127     public void
128     message(String JavaDoc text);
129
130     /**
131      * Displays a message on the error output.
132      *
133      * @param text The message to print.
134      */

135     public void
136     error(String JavaDoc text);
137 }
138
Popular Tags