Class PrefixPattern
- java.lang.Object
-
- net.sourceforge.argparse4j.helper.PrefixPattern
-
public class PrefixPattern extends java.lang.ObjectThis 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.StringgetPrefixChars()Returns prefixChars with this object constructed.java.util.regex.PatterngetPrefixPattern()Returns compiled regular expression pattern of prefixChars.booleanmatch(java.lang.String str)Returnstrueif flag stringstrmatches prefixChars.booleanmatchLongFlag(java.lang.String str)Returnstrueif flag stringstrmatches prefixChars and it is long flag.java.lang.StringremovePrefix(java.lang.String str)Removes prefixChars from given flag string.
-
-
-
Method Detail
-
match
public boolean match(java.lang.String str)
Returnstrueif flag stringstrmatches prefixChars.- Parameters:
str- The flag string to match- Returns:
trueorfalse
-
matchLongFlag
public boolean matchLongFlag(java.lang.String str)
Returnstrueif flag stringstrmatches prefixChars and it is long flag.- Parameters:
str- The flag string to match- Returns:
trueorfalse
-
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.
-
-