KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > ozoneDB > tools > OPP > message > StdOutMessageWriter


1 // You can redistribute this software and/or modify it under the terms of
2
// the Ozone Library License version 1 published by ozone-db.org.
3
//
4
// The original code and portions created by SMB are
5
// Copyright (C) 1997-@year@ by SMB GmbH. All rights reserved.
6
//
7
// $Id: $
8
package org.ozoneDB.tools.OPP.message;
9
10 import org.ozoneDB.tools.OPP.message.MessageWriter;
11
12 public class StdOutMessageWriter implements MessageWriter {
13     private boolean quiet;
14     private boolean debug;
15
16     public boolean isQuiet() {
17         return quiet;
18     }
19
20     public void setQuiet(boolean quiet) {
21         this.quiet = quiet;
22     }
23
24     public boolean isDebug() {
25         return debug;
26     }
27
28     public void setDebug(boolean debug) {
29         this.debug = debug;
30     }
31
32     public StdOutMessageWriter(boolean quiet, boolean debug) {
33         this.quiet = quiet;
34         this.debug = debug;
35     }
36
37     public void startGeneration(String JavaDoc object) {
38         // Do nothing
39
}
40
41     public void error(String JavaDoc message) {
42         System.out.println("ERROR: " + message);
43     }
44
45     public void warning(String JavaDoc message) {
46         System.out.println("WARNING: " + message);
47         System.out.println();
48     }
49
50     public void warning(String JavaDoc filename, int row, String JavaDoc message) {
51         System.out.println("WARNING processing file " + filename + " at line " + row + "!");
52         System.out.println("WARNING: " + message);
53         System.out.println();
54     }
55
56     public void info(String JavaDoc message) {
57         if (!quiet) {
58             System.out.println(message);
59         }
60     }
61
62     public void debug(String JavaDoc message) {
63         if (debug) {
64             System.out.println(message);
65         }
66     }
67
68     public void endGeneration() {
69         // Do nothing
70
}
71 }
72
Popular Tags