Class PrefixPattern
- java.lang.Object
-
- net.sourceforge.argparse4j.helper.PrefixPattern
-
public class PrefixPattern extends java.lang.Object
This object performs operations related to prefixChars of option flags.
The application code should not use this class directly.
-
-
Constructor Summary
Constructors Constructor Description PrefixPattern(java.lang.String prefixChars)
Creates this object using givenprefixChars
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getPrefixChars()
Returns prefixChars with this object constructed.java.util.regex.Pattern
getPrefixPattern()
Returns compiled regular expression pattern of prefixChars.boolean
match(java.lang.String str)
Returnstrue
if flag stringstr
matches prefixChars.boolean
matchLongFlag(java.lang.String str)
Returnstrue
if flag stringstr
matches prefixChars and it is long flag.java.lang.String
removePrefix(java.lang.String str)
Removes prefixChars from given flag string.
-
-
-
Method Detail
-
match
public boolean match(java.lang.String str)
Returnstrue
if flag stringstr
matches prefixChars.- Parameters:
str
- The flag string to match- Returns:
true
orfalse
-
matchLongFlag
public boolean matchLongFlag(java.lang.String str)
Returnstrue
if flag stringstr
matches prefixChars and it is long flag.- Parameters:
str
- The flag string to match- Returns:
true
orfalse
-
removePrefix
public java.lang.String removePrefix(java.lang.String str)
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
public java.lang.String getPrefixChars()
Returns prefixChars with this object constructed.- Returns:
- prefixChars
-
getPrefixPattern
public java.util.regex.Pattern getPrefixPattern()
Returns compiled regular expression pattern of prefixChars.- Returns:
- The compiled regular expression pattern of prefixChars.
-
-