opennlp.tools.cmdline
Class ArgumentParser

java.lang.Object
  extended by opennlp.tools.cmdline.ArgumentParser
All Implemented Interfaces:
InvocationHandler

public class ArgumentParser
extends Object
implements 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!


Nested Class Summary
static interface ArgumentParser.OptionalParameter
           
static interface ArgumentParser.ParameterDescription
           
 
Method Summary
static
<T> String
createUsage(Class<T> argProxyInterface)
           
 Object invoke(Object proxy, Method method, Object[] args)
           
static
<T> T
parse(String[] args, Class<T> argProxyInterface)
           
static
<T> boolean
validateArguments(String[] args, Class<T> argProxyInterface)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

invoke

public Object invoke(Object proxy,
                     Method method,
                     Object[] args)
              throws Throwable
Specified by:
invoke in interface InvocationHandler
Throws:
Throwable

createUsage

public static <T> String createUsage(Class<T> argProxyInterface)

validateArguments

public static <T> boolean validateArguments(String[] args,
                                            Class<T> argProxyInterface)

parse

public static <T> T parse(String[] args,
                          Class<T> argProxyInterface)


Copyright © 2010. All Rights Reserved.