fc.util
Class BasicArgcheckFailHandler

java.lang.Object
  extended by fc.util.BasicArgcheckFailHandler
All Implemented Interfaces:
IArgcheckFailHandler

public class BasicArgcheckFailHandler
extends Object
implements IArgcheckFailHandler

Handles argument Checker errors by printing the thread, time and stack trace to System.err. System.err is chosen because the default assertion mechanism also writes a message to that location. After writing the message to System.err, a new IllegalArgumentException is thrown.

Version:
1.0

Constructor Summary
BasicArgcheckFailHandler()
           
 
Method Summary
 void handle(String msg)
          This method will be called on by the fc.app.Checker class in case of an Argcheck failure.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BasicArgcheckFailHandler

public BasicArgcheckFailHandler()
Method Detail

handle

public void handle(String msg)
Description copied from interface: IArgcheckFailHandler
This method will be called on by the fc.app.Checker class in case of an Argcheck failure. See fc.app.Argcheck.

Therefore, implementations can do neat things like writing detailed thread/stack information or even paging/sending email. After doing other handling, Implementations should end this method by throwing a RuntimeException (unless there is a very strong reason not to).

Specified by:
handle in interface IArgcheckFailHandler