KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > derby > iapi > services > stream > HeaderPrintWriter


1 /*
2
3    Derby - Class org.apache.derby.iapi.services.stream.HeaderPrintWriter
4
5    Licensed to the Apache Software Foundation (ASF) under one or more
6    contributor license agreements. See the NOTICE file distributed with
7    this work for additional information regarding copyright ownership.
8    The ASF licenses this file to you under the Apache License, Version 2.0
9    (the "License"); you may not use this file except in compliance with
10    the License. You may obtain a copy of the License at
11
12       http://www.apache.org/licenses/LICENSE-2.0
13
14    Unless required by applicable law or agreed to in writing, software
15    distributed under the License is distributed on an "AS IS" BASIS,
16    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17    See the License for the specific language governing permissions and
18    limitations under the License.
19
20  */

21
22 package org.apache.derby.iapi.services.stream;
23
24 import java.io.PrintWriter JavaDoc;
25
26 /**
27  * A HeaderPrintWriter is like a PrintWriter with support for
28  * including a header in the output. It is expected users
29  * will use HeaderPrintWriters to prepend headings to trace
30  * and log messages.
31  *
32  */

33 public interface HeaderPrintWriter
34 {
35     /**
36      * Puts out some setup info for
37      * the current write and the write(s) that will be put out next.
38      * It ends with a \n\r.
39      * <p>
40      * All other writes to the stream use the
41      * PrintStream interface.
42      */

43     public void printlnWithHeader(String JavaDoc message);
44
45     /**
46      * Return the header for the stream.
47      */

48     public PrintWriterGetHeader getHeader();
49     
50     /**
51      * Gets a PrintWriter object for writing to this HeaderPrintWriter.
52      * Users may use the HeaderPrintWriter to access methods not included
53      * in this interface or to invoke methods or constructors which require
54      * a PrintWriter.
55      *
56      * Interleaving calls to a printWriter and its associated HeaderPrintWriter
57      * is not supported.
58      *
59      */

60     public PrintWriter JavaDoc getPrintWriter();
61
62     /**
63      * Gets the name of the wrapped writer or stream
64      */

65     public String JavaDoc getName ();
66
67     /*
68      * The routines that mimic java.io.PrintWriter...
69      */

70     /**
71      * @see java.io.PrintWriter#print
72      */

73     public void print(String JavaDoc message);
74
75     /**
76      * @see java.io.PrintWriter#println
77      */

78     public void println(String JavaDoc message);
79
80     /**
81      * @see java.io.PrintWriter#println
82      */

83     public void println(Object JavaDoc message);
84
85     /**
86     * @see java.io.PrintWriter#flush
87      */

88     public void flush();
89 }
90
91
Popular Tags