summaryrefslogtreecommitdiff
path: root/sources/scala/tools/util/Reporter.java
blob: b2411e06497166c71367ce60a0774e23c5dbcf96 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
/*     ____ ____  ____ ____  ______                                     *\
**    / __// __ \/ __// __ \/ ____/    SOcos COmpiles Scala             **
**  __\_ \/ /_/ / /__/ /_/ /\_ \       (c) 2002, LAMP/EPFL              **
** /_____/\____/\___/\____/____/                                        **
\*                                                                      */

// $Id$

package scala.tools.util;

/**
 * This interface provides methods to issue information, warning and
 * error messages.
 */
public interface Reporter {

    //########################################################################
    // Public Methods - Flags

    /** Are information messages issued? */
    public boolean verbose();
    /** Are warnings issued? */
    public boolean nowarn();
    /** Is a prompt displayed after errors and warnings? */
    public boolean prompt();

    /** Sets whether information messages are issued. */
    public void verbose(boolean verbose);
    /** Sets whether warnings are issued. */
    public void nowarn(boolean nowarn);
    /** Sets whether a prompt is displayed after errors and warnings. */
    public void prompt(boolean prompt);

    //########################################################################
    // Public Methods - Count

    /** Returns the number of warnings issued. */
    public int warnings();

    /** Returns the number of errors issued. */
    public int errors();

    /** Resets all counters. */
    public void resetCounters();

    //########################################################################
    // Public Methods - Report

    /**
     * Issues an information. The position may be null. If force is
     * true, the message is displayed even in non-verbose mode.
     */
    public void info(Position position, String message, boolean force);

    /** Issues a warning. The position may be null. */
    public void warning(Position position, String message);

    /** Issues an error. The position may be null. */
    public void error(Position position, String message);

    //########################################################################
}