public class CFGOptionMatcher
extends java.lang.Object
CFGOptionMatcher
maintains a set of named
options, and provides a means for matching abbreviated option
values against those names.Modifier and Type | Class and Description |
---|---|
static class |
CFGOptionMatcher.CFGOption
The type stored within a
CFGOptionMatcher . |
Constructor and Description |
---|
CFGOptionMatcher(CFGOptionMatcher.CFGOption[] options)
Creates a CFGOptionMatcher.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
help(int initialIndent,
int rightMargin,
int hangingIndent)
Returns a string containing the names of all the
options in this
CFGOptionMatcher , separated by
'|' characters. |
CFGOptionMatcher.CFGOption |
match(java.lang.String quarry)
Searches the options in this
CFGOptionMatcher
looking for one whose name begins with the passed string
(ignoring the case of letters in the string). |
public CFGOptionMatcher(CFGOptionMatcher.CFGOption[] options)
options
- The set of command options to be stored.public CFGOptionMatcher.CFGOption match(java.lang.String quarry) throws CompilationDeathException
CFGOptionMatcher
looking for one whose name begins with the passed string
(ignoring the case of letters in the string).quarry
- The string to be matched against the stored
option names.CFGOptionMatcher.CFGOption
, if exactly one of the
stored option names begins with quarry
.CompilationDeathException
- if quarry
matches none of the option names, or if it matches more than
one.public java.lang.String help(int initialIndent, int rightMargin, int hangingIndent)
CFGOptionMatcher
, separated by
'|' characters. The string is intended for use in
help messages.initialIndent
- The number of blank spaces to insert at the
beginning of the returned string. Ignored if
negative.rightMargin
- If positive, newlines will be inserted to try
to keep the length of each line in the
returned string less than or equal to
rightMargin
.hangingIndent
- If positive, this number of spaces will be
inserted immediately after each newline
inserted to respect the rightMargin
.