Package owl.run
Class RunUtil
- java.lang.Object
-
- owl.run.RunUtil
-
public final class RunUtil extends Object
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static boolean
checkDefaultAnnotationOption(org.apache.commons.cli.CommandLine settings)
static void
checkForVersion(String[] args)
static void
execute(Callable<Void> runner)
Executes the given given runner and logs any occurring error to the console.static AssertionError
failWithMessage(String message)
Prints givenmessage
on standard error and callsSystem.exit(int)
with 1.static AssertionError
failWithMessage(String message, Throwable cause)
static org.apache.commons.cli.Option
getDefaultAnnotationOption()
-
-
-
Method Detail
-
getDefaultAnnotationOption
public static org.apache.commons.cli.Option getDefaultAnnotationOption()
-
checkDefaultAnnotationOption
public static boolean checkDefaultAnnotationOption(org.apache.commons.cli.CommandLine settings)
-
failWithMessage
public static AssertionError failWithMessage(String message)
Prints givenmessage
on standard error and callsSystem.exit(int)
with 1. An exception is returned to allow for one-line statements likethrow failWithMessage("error!")
. This approximates the actual control flow as precise as possible, sinceSystem.exit(int)
does not return, but the compiler doesn't know about this.
-
failWithMessage
public static AssertionError failWithMessage(String message, Throwable cause)
- See Also:
failWithMessage(String)
-
checkForVersion
public static void checkForVersion(String[] args)
-
-