org.clapper.util.cmdline
Interface ParameterHandler


public interface ParameterHandler

Thie interface defines the callback methods used by a ParameterParser object, when its parse() method is called.

Author:
Copyright © 2004-2007 Brian M. Clapper
See Also:
ParameterParser, CommandLineUtility

Method Summary
 void parseOption(char shortOption, java.lang.String longOption, java.util.Iterator<java.lang.String> it)
          Handles a parsed option.
 void parsePostOptionParameters(java.util.Iterator<java.lang.String> it)
          Handles all parameters that appear after the end of the options.
 

Method Detail

parseOption

void parseOption(char shortOption,
                 java.lang.String longOption,
                 java.util.Iterator<java.lang.String> it)
                 throws CommandLineUsageException,
                        java.util.NoSuchElementException
Handles a parsed option.

Parameters:
shortOption - the (character) short option, if any; otherwise, the constant UsageInfo.NO_SHORT_OPTION.
longOption - the (string) long option, if any; otherwise, null.
it - An Iterator from which to retrieve any value(s) for the option
Throws:
CommandLineUsageException - on error
java.util.NoSuchElementException - attempt to iterate past end of args; ParameterParser.parse(java.lang.String[], org.clapper.util.cmdline.ParameterHandler) automatically handles this exception, so it's safe for implementations of this method not to handle it

parsePostOptionParameters

void parsePostOptionParameters(java.util.Iterator<java.lang.String> it)
                               throws CommandLineUsageException,
                                      java.util.NoSuchElementException
Handles all parameters that appear after the end of the options. If there are no such parameters, the implementation of this method should just return without doing anything.

Parameters:
it - the Iterator containing the parameters
Throws:
CommandLineUsageException - on error
java.util.NoSuchElementException - attempt to iterate past end of args; ParameterParser.parse(java.lang.String[], org.clapper.util.cmdline.ParameterHandler) automatically handles this exception, so it's safe for implementations of this method not to handle it


Copyright © 2004-2007 Brian M. Clapper. All Rights Reserved.