Package soot.util.cfgcmd
Class CFGOptionMatcher
- java.lang.Object
-
- soot.util.cfgcmd.CFGOptionMatcher
-
public class CFGOptionMatcher extends Object
A class used by CFG utilities that need to match different option strings with classes that implement those options. ACFGOptionMatchermaintains a set of named options, and provides a means for matching abbreviated option values against those names.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classCFGOptionMatcher.CFGOptionThe type stored within aCFGOptionMatcher.
-
Constructor Summary
Constructors Constructor Description CFGOptionMatcher(CFGOptionMatcher.CFGOption[] options)Creates a CFGOptionMatcher.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Stringhelp(int initialIndent, int rightMargin, int hangingIndent)Returns a string containing the names of all the options in thisCFGOptionMatcher, separated by '|' characters.CFGOptionMatcher.CFGOptionmatch(String quarry)Searches the options in thisCFGOptionMatcherlooking for one whose name begins with the passed string (ignoring the case of letters in the string).
-
-
-
Constructor Detail
-
CFGOptionMatcher
public CFGOptionMatcher(CFGOptionMatcher.CFGOption[] options)
Creates a CFGOptionMatcher.- Parameters:
options- The set of command options to be stored.
-
-
Method Detail
-
match
public CFGOptionMatcher.CFGOption match(String quarry) throws CompilationDeathException
Searches the options in thisCFGOptionMatcherlooking for one whose name begins with the passed string (ignoring the case of letters in the string).- Parameters:
quarry- The string to be matched against the stored option names.- Returns:
- The matching
CFGOptionMatcher.CFGOption, if exactly one of the stored option names begins withquarry. - Throws:
CompilationDeathException- ifquarrymatches none of the option names, or if it matches more than one.
-
help
public String help(int initialIndent, int rightMargin, int hangingIndent)
Returns a string containing the names of all the options in thisCFGOptionMatcher, separated by '|' characters. The string is intended for use in help messages.- Parameters:
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 torightMargin.hangingIndent- If positive, this number of spaces will be inserted immediately after each newline inserted to respect therightMargin.
-
-