org.jagatoo.commandline
Class ArgumentsHandler

java.lang.Object
  extended by org.jagatoo.commandline.ArgumentsHandler

public abstract class ArgumentsHandler
extends java.lang.Object

Handles arguments from the command line.


Constructor Summary
ArgumentsHandler()
           
 
Method Summary
protected abstract  void handleArgument(Argument arg, java.lang.Object value)
          This method is called when the parser has identified an argument with or without a value.
protected  void onError(int chunk, java.lang.String message)
          This method is called when a serious error is detected byy the parser.
protected abstract  void validate()
          This method is called after the whole command line has been parsed.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ArgumentsHandler

public ArgumentsHandler()
Method Detail

handleArgument

protected abstract void handleArgument(Argument arg,
                                       java.lang.Object value)
This method is called when the parser has identified an argument with or without a value.

Parameters:
arg - the detected argument (null for loose values)
value - the value (null for no-value-arguments)

onError

protected void onError(int chunk,
                       java.lang.String message)
                throws CommandlineParsingException
This method is called when a serious error is detected byy the parser.

Parameters:
chunk - the command line chunk number
message - the error message
Throws:
CommandlineParsingException

validate

protected abstract void validate()
                          throws CommandlineParsingException
This method is called after the whole command line has been parsed.

Throws:
CommandlineParsingException