public class ArgumentHandler extends Object
| Constructor and Description |
|---|
ArgumentHandler(String[] arguments) |
| Modifier and Type | Method and Description |
|---|---|
<I> I |
getInstance(Class<I> interfaceClass)
This methods uses
AnnotatedInterfaceArguments to return an
instance of the specified class with methods returning values from the
arguments of this Handler. |
void |
processArguments(ArgumentProcessor processor) |
static <A> A |
readArguments(Class<A> interfaceClass,
String[] args)
Returns an instance of A if the arguments could be correctly parsed
and A was not a subclass of ArgumentsWithHelp or no help was requested, null
otherwise.
|
public ArgumentHandler(String[] arguments)
public void processArguments(ArgumentProcessor processor) throws InvalidArgumentsException
InvalidArgumentsExceptionpublic <I> I getInstance(Class<I> interfaceClass) throws InvalidArgumentsException
AnnotatedInterfaceArguments to return an
instance of the specified class with methods returning values from the
arguments of this Handler.
Note that the interface must be annotated using CommandLine.I - the type of the interfaceinterfaceClass - a class instance for I, i.e. I.classInvalidArgumentsException - thrown when the argument-list doesn't match the definition in the interface annotationspublic static <A> A readArguments(Class<A> interfaceClass, String[] args)
A - interfaceClass - args - Copyright © 2014. All Rights Reserved.