com.unitesk.atp.messages
Class NullMessageBox

java.lang.Object
  extended by com.unitesk.atp.messages.NullMessageBox
All Implemented Interfaces:
MessageBox
Direct Known Subclasses:
ListMessageBox, PrintStreamMessageBox

public class NullMessageBox
extends Object
implements MessageBox

The message box that discards all messages but counts them.

Version:
$Id: NullMessageBox.java,v 1.3 2004/10/12 08:23:12 all-x Exp $
Author:
Alexey Demakov

Field Summary
protected  MessageContext context
           
protected  MessageStringManager sm
           
 
Constructor Summary
NullMessageBox()
          Creates message box with default string manager.
NullMessageBox(MessageStringManager sm)
          Creates message box with the specified string manager.
 
Method Summary
 void error(Message message)
          Outputs error message.
protected  void errorStr(String message)
           
 void fatal(Message message)
          Outputs error message and stops program execution.
 int getErrorCount()
          Returns error messages count.
 int getInfoCount()
          Returns information messages count.
 MessageStringManager getStringManager()
          Returns localized string manager for this message box.
 int getWarningCount()
          Returns warning messages count.
 void info(Message message)
          TODO: make deprecated Outputs information message.
 void info(String message)
          Outputs information line.
protected  void infoStr(String message)
           
 void statistics()
          Prints message box statistics.
 void status()
          If error count greater than zero, prints statistics and stops program execution.
 void stop(int code)
          Stops program execution by throwing FatalErrorException.
 void warning(Message message)
          Outputs warning message.
protected  void warningStr(String message)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

context

protected MessageContext context

sm

protected MessageStringManager sm
Constructor Detail

NullMessageBox

public NullMessageBox()
Creates message box with default string manager.

See Also:
NullMessageBox(MessageStringManager)

NullMessageBox

public NullMessageBox(MessageStringManager sm)
Creates message box with the specified string manager.

Parameters:
sm - The specified string manager.
Method Detail

fatal

public void fatal(Message message)
Outputs error message and stops program execution. Increments error counter.

Specified by:
fatal in interface MessageBox
Parameters:
message - The error message.

error

public void error(Message message)
Outputs error message. Increments error counter.

Specified by:
error in interface MessageBox
Parameters:
message - The error message.

warning

public void warning(Message message)
Outputs warning message. Increments warning counter.

Specified by:
warning in interface MessageBox
Parameters:
message - The warning message.

info

public void info(Message message)
TODO: make deprecated Outputs information message. Increments information counter.

Specified by:
info in interface MessageBox
Parameters:
message - The information message.

info

public void info(String message)
Outputs information line. Increments information counter.

Specified by:
info in interface MessageBox
Parameters:
message - The information message.

getErrorCount

public int getErrorCount()
Returns error messages count.

Specified by:
getErrorCount in interface MessageBox
Returns:
The error count.

getWarningCount

public int getWarningCount()
Returns warning messages count.

Specified by:
getWarningCount in interface MessageBox
Returns:
The warning count.

getInfoCount

public int getInfoCount()
Returns information messages count.

Specified by:
getInfoCount in interface MessageBox
Returns:
The info count.

statistics

public void statistics()
Prints message box statistics.

Specified by:
statistics in interface MessageBox

status

public void status()
If error count greater than zero, prints statistics and stops program execution.

Specified by:
status in interface MessageBox

stop

public void stop(int code)
Stops program execution by throwing FatalErrorException.

Specified by:
stop in interface MessageBox
Parameters:
code - Exit status code

getStringManager

public MessageStringManager getStringManager()
Returns localized string manager for this message box. Localized string manager is used to translate messages to text.

Specified by:
getStringManager in interface MessageBox

errorStr

protected void errorStr(String message)

warningStr

protected void warningStr(String message)

infoStr

protected void infoStr(String message)


Copyright © 2001-2006 ISP RAS, RedVerst Group. All Rights Reserved.