public class JSamp
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
(package private) static java.lang.String[] |
COMMAND_CLASSES
Known command class names.
|
Modifier | Constructor and Description |
---|---|
private |
JSamp()
Private sole constructor prevents instantiation.
|
Modifier and Type | Method and Description |
---|---|
private static java.lang.String |
abbrev(java.lang.String className)
Returns the abbreviated form of a given class name.
|
private static java.lang.String |
formatImpls(java.lang.Object[] options,
java.lang.Class clazz) |
(package private) static java.lang.reflect.Method |
getMainMethod(java.lang.Class clazz)
Returns the
main(String[]) method for a given class. |
private static java.lang.String |
getVersionText()
Returns a string giving version details for this package.
|
static void |
main(java.lang.String[] args)
Main method.
|
private static int |
runCommand(java.lang.String className,
java.lang.String[] args)
Runs a command.
|
static int |
runMain(java.lang.String[] args)
Does the work for the main method.
|
private static void |
setDefaultProperty(java.lang.String key,
java.lang.String value)
Sets a system property to a given value unless it has already been set.
|
static final java.lang.String[] COMMAND_CLASSES
public static int runMain(java.lang.String[] args)
private static int runCommand(java.lang.String className, java.lang.String[] args)
className
- name of a class with a main(String[])
methodargs
- arguments as if passed from the command linestatic java.lang.reflect.Method getMainMethod(java.lang.Class clazz)
main(String[])
method for a given class.private static java.lang.String abbrev(java.lang.String className)
className
- class nameprivate static java.lang.String formatImpls(java.lang.Object[] options, java.lang.Class clazz)
private static java.lang.String getVersionText()
private static void setDefaultProperty(java.lang.String key, java.lang.String value)
key
- property namevalue
- suggested property valuepublic static void main(java.lang.String[] args)