Package EDU.purdue.jtb.common
Class Messages
java.lang.Object
EDU.purdue.jtb.common.Messages
Class
Messages
handles messages (informations, warnings and fatal errors), printing a message to
the user and handling it appropriately.
Class maintains state, and is not supposed to be run in parallel threads (on the same grammar).
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint
static void
Prints on System.err a fatal error message and the stack trace.static void
Prints on System.err a fatal error message and the stack trace.void
Prints on System.out an information text.void
Prints on System.out an information text and its line number.int
void
Prints on System.err the number of informations, warnings and errorsvoid
Resets to zero the number of errors and warnings.void
Prints on System.err a soft (non fatal) error text.void
Prints on System.err a soft (non fatal) error text and its line number.void
Prints on System.err a warning text.void
Prints on System.err a warning text and its line number.int
-
Constructor Details
-
Messages
public Messages()
-
-
Method Details
-
printSummary
public void printSummary()Prints on System.err the number of informations, warnings and errors -
info
Prints on System.out an information text.- Parameters:
s
- - the information text
-
info
Prints on System.out an information text and its line number.- Parameters:
s
- - the information textlineNum
- - the information line numbercolNum
- - the information column number
-
warning
Prints on System.err a warning text.- Parameters:
s
- - the warning text
-
warning
Prints on System.err a warning text and its line number.- Parameters:
s
- - the warning textlineNum
- - the warning line numbercolNum
- - the warning column number
-
softErr
Prints on System.err a soft (non fatal) error text.- Parameters:
s
- - an error text
-
softErr
Prints on System.err a soft (non fatal) error text and its line number.- Parameters:
s
- - the error textlineNum
- - the error line numbercolNum
- - the error column number
-
hardErr
Prints on System.err a fatal error message and the stack trace.- Parameters:
s
- - a message
-
hardErr
Prints on System.err a fatal error message and the stack trace.- Parameters:
s
- - a messaget
- - a Throwable
-
infoCount
public int infoCount()- Returns:
- the number of informations
-
warningCount
public int warningCount()- Returns:
- the number of warnings
-
errorCount
public int errorCount()- Returns:
- the number of errors
-
resetCounts
public void resetCounts()Resets to zero the number of errors and warnings.
-