public class OptionValidator
extends java.lang.Object
Constructor and Description |
---|
OptionValidator() |
Modifier and Type | Method and Description |
---|---|
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(java.lang.String opt)
Validates whether
opt is a permissable Option
shortOpt. |
static void validateOption(java.lang.String opt) throws java.lang.IllegalArgumentException
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.opt
- The option string to validatejava.lang.IllegalArgumentException
- if the Option is not valid.private static boolean isValidOpt(char c)
Returns whether the specified character is a valid Option.
c
- the option to validatec
is a letter, ' ', '?' or '@',
otherwise false.private static boolean isValidChar(char c)
Returns whether the specified character is a valid character.
c
- the character to validatec
is a letter.