| Constructor and Description |
|---|
ArgumentProcessor() |
| Modifier and Type | Method and Description |
|---|---|
abstract ParsingContext |
createParsingContext() |
static <T> ArgumentProcessor<T> |
forType(Class<T> beanType)
Create new instance with default parser, a
GnuParser |
static <T> ArgumentProcessor<T> |
forTypeOf(T bean) |
static <T> ArgumentProcessor<T> |
newInstance(Class<? extends T> beanType,
CommandLineParser parser)
Create new instance with given bean type and command line parser that describes command line
sytnax.
|
static <T> ArgumentProcessor<T> |
newInstance(Class<T> beanType)
Deprecated.
Use
forType(Class) instead. |
abstract void |
printHelp(PrintWriter out) |
abstract void |
process(List<String> arguments,
T bean)
Process argument list and pass values to given bean
|
void |
process(String[] arguments,
T bean)
Process argument array and pass values to given bean
|
abstract ValidationResult |
validate(String[] arguments)
Verifies if given arguments meet requirement defined for processor.
|
public static <T> ArgumentProcessor<T> forType(Class<T> beanType)
GnuParserT - Type of the beanbeanType - Type of the beanpublic static <T> ArgumentProcessor<T> forTypeOf(T bean)
public static <T> ArgumentProcessor<T> newInstance(Class<? extends T> beanType, CommandLineParser parser)
T - type of beanbeanType - Type of beanparser - command line parser that is aware of command line syntaxpublic static <T> ArgumentProcessor<T> newInstance(Class<T> beanType)
forType(Class) instead.T - type of bean class.beanType - type of the bean.public abstract ParsingContext createParsingContext()
public abstract void printHelp(PrintWriter out) throws IOException
out - Output to print help message toIOException - Allows IO errorspublic abstract void process(List<String> arguments, T bean)
arguments - List of argumentsbean - Bean to pass values topublic void process(String[] arguments, T bean)
arguments - Arary of argumentsbean - Bean to pass values topublic abstract ValidationResult validate(String[] arguments)
arguments - array of command line arguments.Copyright © 2008–2018. All rights reserved.