public static class CommandLine.RegexTransformer.Builder extends Object
RegexTransformer
objects.Constructor and Description |
---|
Builder()
Constructs an empty builder.
|
Builder(CommandLine.RegexTransformer old)
Constructs a builder populated with the values from the specified RegexTransformer.
|
Modifier and Type | Method and Description |
---|---|
CommandLine.RegexTransformer.Builder |
addPattern(String regex,
String negativeReplacement,
String synopsisReplacement)
Adds the specified negative replacement and synopsis replacement for the specified regular expression.
|
CommandLine.RegexTransformer |
build() |
CommandLine.RegexTransformer.Builder |
removePattern(String regex)
Removes the negative replacement and synopsis replacement for the specified regular expression.
|
public Builder()
public Builder(CommandLine.RegexTransformer old)
public CommandLine.RegexTransformer.Builder addPattern(String regex, String negativeReplacement, String synopsisReplacement)
Regex | Negative Replacement | Synopsis Replacement | Comment |
---|---|---|---|
^-(\w)$ | +$1 | (+|-)$1 | Converts -v to +v |
^\+(\w)$ | -$1 | (+|-)$1 | Converts -v to +v |
regex
- regular expression to match an option namenegativeReplacement
- the replacement to use to generate a negative name when the option name matchessynopsisReplacement
- the replacement to use to generate a documentation string when the option name matchesRegexTransformer
for method chainingpublic CommandLine.RegexTransformer.Builder removePattern(String regex)
regex
- regular expression to removeRegexTransformer
for method chainingpublic CommandLine.RegexTransformer build()