com.townleyenterprises.command
Interface CommandListener

All Known Implementing Classes:
AbstractCommandListener, CommandParser

public interface CommandListener

This interface must be implemented by classes that intend to respond to command-line arguments processed by the CommandParser.

Since:
2.0
Version:
$Id: CommandListener.java,v 1.3 2004/07/28 10:33:58 atownley Exp $
Author:
Andrew S. Townley

Method Summary
 java.lang.String getDescription()
          This method is used to retrieve the description of the command listener's options when printing the help message.
 CommandOption[] getOptions()
          This method is called by the CommandParser to determine all of the arguments that should be handled by the listener.
 void optionMatched(CommandOption opt, java.lang.String arg)
          This method is called whenever an arguement registered with the parser is detected in the argument stream.
 

Method Detail

getDescription

public java.lang.String getDescription()
This method is used to retrieve the description of the command listener's options when printing the help message. Usually it is the name of the application or subsystem.


getOptions

public CommandOption[] getOptions()
This method is called by the CommandParser to determine all of the arguments that should be handled by the listener.

Returns:
an array of CommandOption arguments. In the case where no arguments are specified (why would you bother?), a zero-length array should be returned.

optionMatched

public void optionMatched(CommandOption opt,
                          java.lang.String arg)
This method is called whenever an arguement registered with the parser is detected in the argument stream.

Parameters:
opt - the CommandOption matched by the parser
arg - the argument (if any) specified for the option


Copyright © 2002-2004, Andrew S. Townley and Townley Enterprises. All Rights Reserved.
This project is hosted on http://te-code.sourceforge.net.