|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.github.croesch.micro_debug.argument.AArgument
public abstract class AArgument
Enumeration of all possible command line arguments for the debugger.
| Constructor Summary | |
|---|---|
protected |
AArgument()
Constructs a new argument with its name as long argument and its first letter as short argument. |
protected |
AArgument(int nop)
Constructs a new argument with its name as long argument and its first letter as short argument. |
| Method Summary | |
|---|---|
static java.util.Map<AArgument,java.lang.String[]> |
createArgumentList(java.lang.String[] args)
Converts a given array of Strings into a Map that contains an entry for each valid
AArgument and the possible parameters belonging to it. |
abstract boolean |
execute(java.lang.String... params)
Executes commands that result in the specific argument. |
protected boolean |
matches(java.lang.String argStr)
Returns whether this argument can be called with the given String. |
protected abstract java.lang.String |
name()
Returns the name of this argument containing only lower case characters and -. |
static AArgument |
of(java.lang.String s)
Returns the AArgument that matches with the given String. |
static void |
releaseAllResources()
Releases important references. |
static java.util.List<AArgument> |
values()
Returns the list of arguments that are available. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
protected AArgument()
--argument-a_ in the name will be translated to a -.
AArgument(int)protected AArgument(int nop)
--argument-a_ in the name will be translated to a -.
nop - the number of parameters this argument requiresAArgument()| Method Detail |
|---|
protected final boolean matches(java.lang.String argStr)
String. Will return false, if the
given String is null or if the AArgument is a pseudo-argument that cannot be called.
argStr - the String to test if it's a possible call for this argument
true, if this argument can be called with the given String.--argument will return true for the argument ARGUMENT.@Nullable public static AArgument of(java.lang.String s)
AArgument that matches with the given String.
s - the String that is able to call the returned AArgument.
AArgument that matches the given String, or null if no argument can be
called with the given String.matches(String)@NotNull public static java.util.Map<AArgument,java.lang.String[]> createArgumentList(java.lang.String[] args)
Strings into a Map that contains an entry for each valid
AArgument and the possible parameters belonging to it.
args - the array of Strings
Map that contains pairs of AArguments and arrays of strings that contain all parameters
for that argument.public abstract boolean execute(java.lang.String... params)
params - the parameters of that argument, in case of the pseudo arguments (prefix ERROR_) this array contains
the causes for the error.
false, if the argument enforces the application to stop@NotNull protected abstract java.lang.String name()
public static void releaseAllResources()
@NotNull public static java.util.List<AArgument> values()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||