kiwi.util
Interface CommandProcessor


public abstract interface CommandProcessor

Helper class for the CommandDispatcher. CommandProcessor is a minimal interface that declares error handling methods for the CommandDispatcher; however, the class that implements this interface should also define all of the actual command processing methods; reflection is used to analyze this class and compile a command dictionary.

Version:
1.0 (05/98)
Author:
Mark Lindner, PING Software Group
See Also:
CommandDispatcher

Method Summary
 void argumentCountError(String cmd)
          Argument count error handler.
 void argumentFormatError(String cmd, String arg)
          Argument format error handler.
 void invocationError(String cmd, Exception ex)
          Invocation error handler.
 void unknownCommandError(String cmd)
          Unknown command error handler.
 

Method Detail

invocationError

public void invocationError(String cmd,
                            Exception ex)
Invocation error handler. This method is called by the command dispatcher when an error occurrs while invoking a command processor method.
Parameters:
cmd - The command that was being processed.
ex - The exception that was thrown.

argumentCountError

public void argumentCountError(String cmd)
Argument count error handler. This method is called by the command dispatcher when a command is invoked with an incorrect number of arguments.
Parameters:
cmd - The command that was being processed.

argumentFormatError

public void argumentFormatError(String cmd,
                                String arg)
Argument format error handler. This method is called by the command dispatcher when a command is invoked with one or more incorrect argument types.
Parameters:
cmd - The command that was being processed.
arg - The offending argument.

unknownCommandError

public void unknownCommandError(String cmd)
Unknown command error handler. This method is called by the command dispatcher when an unknown command is received.
Parameters:
cmd - The offending command.