org.apache.commons.cli
Class OptionValidator
java.lang.Object
org.apache.commons.cli.OptionValidator
public class OptionValidator
extends java.lang.Object
Validates an Option string.
- John Keyes ( john at integralsource.com )
private static boolean | isValidChar(char c) - Returns whether the specified character is a valid character.
|
private static boolean | isValidOpt(char c) - Returns whether the specified character is a valid Option.
|
(package private) static void | validateOption(String opt) - Validates whether
opt is a permissable Option
shortOpt.
|
isValidChar
private static boolean isValidChar(char c)
Returns whether the specified character is a valid character.
c
- the character to validate
isValidOpt
private static boolean isValidOpt(char c)
Returns whether the specified character is a valid Option.
c
- the option to validate
- true if
c
is a letter, ' ', '?' or '@',
otherwise false.
validateOption
(package private) static void validateOption(String opt)
throws IllegalArgumentException
Validates whether
opt
is a permissable Option
shortOpt. The rules that specify if the
opt
is valid are:
opt
is not NULL- a single character
opt
that is either
' '(special case), '?', '@' or a letter - a multi character
opt
that only contains
letters.
opt
- The option string to validate