|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--mark.core.args.ArgUtil
Provides a number of routines that help manage specific arguments in an ArgHelper.
| Constructor Summary | |
ArgUtil()
|
|
| Method Summary | |
static java.lang.String |
addPrefix(java.lang.String prefix,
java.lang.String arg)
Constructs a new string from the given arg string as follows: capitalizes the second character and inserts the prefix string between the first and second characters. |
static java.lang.String[] |
addPrefix(java.lang.String prefix,
java.lang.String[] args)
Replaces each arg string in the given array with a new arg string constructed by calling addPrefix (String, String). |
static java.io.FileFilter |
extractFileFilter(ArgHelper args,
boolean required,
java.lang.String prefix)
Extracts a FileFilter argument from the given ArgHelper. |
static java.util.ArrayList |
extractFileSet(ArgHelper args,
boolean required,
java.lang.String prefix,
java.io.FileFilter ff)
Extracts a file set argument from the given ArgHelper. |
static void |
extractFilesFromFile(ArgHelper args,
boolean required,
java.lang.String match,
java.util.Collection c)
Extracts a filename from the given ArgHelper and fills the given collection with files corresponding to the paths in the file. |
static void |
extractWordsFromFile(ArgHelper args,
boolean required,
java.lang.String match,
boolean lowerCase,
java.util.Collection c)
Extracts a filename from the given ArgHelper and fills the given collection with the words in the file. |
static java.lang.String |
fileFilterUsage(java.lang.String prefix)
Returns the usage string for a FileFilter argument. |
static java.lang.String |
fileSetUsage(java.lang.String prefix)
Returns the usage string for a file set argument. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public ArgUtil()
| Method Detail |
public static java.lang.String addPrefix(java.lang.String prefix,
java.lang.String arg)
prefix - the prefix string.arg - the arg string.
public static java.lang.String[] addPrefix(java.lang.String prefix,
java.lang.String[] args)
prefix - the prefix string.args - the arg strings.
public static void extractWordsFromFile(ArgHelper args,
boolean required,
java.lang.String match,
boolean lowerCase,
java.util.Collection c)
throws java.lang.Exception
args - the ArgHelper.required - whether to throw an exception if the argument is not
in args.match - the argument that precededs the filename in args.lowerCase - whether to convert the words to lower-case before
returning them.c - the collection.
java.lang.Exception
public static void extractFilesFromFile(ArgHelper args,
boolean required,
java.lang.String match,
java.util.Collection c)
throws java.lang.Exception
args - the ArgHelper.required - whether to throw an exception if the argument is not in
args.match - the argument that precededs the filename in args.c - the collection.
java.lang.Exceptionpublic static java.lang.String fileFilterUsage(java.lang.String prefix)
prefix - the name of the arguement (if more than one of same type).
public static java.io.FileFilter extractFileFilter(ArgHelper args,
boolean required,
java.lang.String prefix)
throws java.lang.Exception
args - the ArgHelper.required - whether the argument is required.prefix - the name of the argument (if more than one of same type).
java.lang.Exception - if there is no filter and required.public static java.lang.String fileSetUsage(java.lang.String prefix)
prefix - the name of the arguement (if more than one of same type).
public static java.util.ArrayList extractFileSet(ArgHelper args,
boolean required,
java.lang.String prefix,
java.io.FileFilter ff)
throws java.lang.Exception
args - the ArgHelper.required - whether the argument is required.prefix - the name of the argument (if more than one of same type).ff - the file filter.
java.lang.Exception - if there is no file set and required.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||