opennlp.tools.cmdline
Class ArgumentParser
java.lang.Object
opennlp.tools.cmdline.ArgumentParser
- All Implemented Interfaces:
- java.lang.reflect.InvocationHandler
public class ArgumentParser
- extends java.lang.Object
- implements java.lang.reflect.InvocationHandler
Parser for command line arguments. The parser creates a dynamic proxy which
can be access via a command line argument interface.
The command line argument proxy interface must follow these conventions:
- Methods do not define arguments
- Method names must start with get
- Allowed return types are Integer, Boolean and String
Note: Do not use this class, internal use only!
Method Summary |
static
|
createUsage(java.lang.Class<T> argProxyInterface)
|
java.lang.Object |
invoke(java.lang.Object proxy,
java.lang.reflect.Method method,
java.lang.Object[] args)
|
static
|
parse(java.lang.String[] args,
java.lang.Class<T> argProxyInterface)
|
static
|
validateArguments(java.lang.String[] args,
java.lang.Class<T> argProxyInterface)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
invoke
public java.lang.Object invoke(java.lang.Object proxy,
java.lang.reflect.Method method,
java.lang.Object[] args)
throws java.lang.Throwable
- Specified by:
invoke
in interface java.lang.reflect.InvocationHandler
- Throws:
java.lang.Throwable
createUsage
public static <T> java.lang.String createUsage(java.lang.Class<T> argProxyInterface)
validateArguments
public static <T> boolean validateArguments(java.lang.String[] args,
java.lang.Class<T> argProxyInterface)
parse
public static <T> T parse(java.lang.String[] args,
java.lang.Class<T> argProxyInterface)
Copyright © 2011 The Apache Software Foundation. All Rights Reserved.