Class PrefixPattern
java.lang.Object
net.sourceforge.argparse4j.helper.PrefixPattern
This object performs operations related to prefixChars of option flags.
The application code should not use this class directly.
-
Constructor Summary
ConstructorsConstructorDescriptionPrefixPattern
(String prefixChars) Creates this object using givenprefixChars
. -
Method Summary
Modifier and TypeMethodDescriptionReturns prefixChars with this object constructed.Returns compiled regular expression pattern of prefixChars.boolean
Returnstrue
if flag stringstr
matches prefixChars.boolean
matchLongFlag
(String str) Returnstrue
if flag stringstr
matches prefixChars and it is long flag.removePrefix
(String str) Removes prefixChars from given flag string.
-
Constructor Details
-
PrefixPattern
Creates this object using givenprefixChars
.- Parameters:
prefixChars
- The prefixChars
-
-
Method Details
-
match
Returnstrue
if flag stringstr
matches prefixChars.- Parameters:
str
- The flag string to match- Returns:
true
orfalse
-
matchLongFlag
Returnstrue
if flag stringstr
matches prefixChars and it is long flag.- Parameters:
str
- The flag string to match- Returns:
true
orfalse
-
removePrefix
Removes prefixChars from given flag string.
If given flag string does not contains prefixChars, it is returned as is.
- Parameters:
str
- The flag string- Returns:
- The string after prefixChars are removed from
str
-
getPrefixChars
Returns prefixChars with this object constructed.- Returns:
- prefixChars
-
getPrefixPattern
Returns compiled regular expression pattern of prefixChars.- Returns:
- The compiled regular expression pattern of prefixChars.
-