org.apache.commons.cli
public class OptionValidator extends Object
Method Summary | |
---|---|
static boolean | isValidChar(char c) Returns whether the specified character is a valid character. |
static boolean | isValidOpt(char c) Returns whether the specified character is a valid Option. |
static void | validateOption(String opt) Validates whether |
Returns whether the specified character is a valid character.
Parameters: c the character to validate
Returns: true if c
is a letter.
Returns whether the specified character is a valid Option.
Parameters: c the option to validate
Returns: true if c
is a letter, ' ', '?' or '@',
otherwise false.
Validates whether opt
is a permissable Option
shortOpt. The rules that specify if the opt
is valid are:
opt
is not NULLopt
that is either
' '(special case), '?', '@' or a letteropt
that only contains
letters.Parameters: opt The option string to validate
Throws: IllegalArgumentException if the Option is not valid.