opennlp.tools.cmdline
Class ArgumentParser

java.lang.Object
  extended by 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!


Nested Class Summary
static interface ArgumentParser.OptionalParameter
           
static interface ArgumentParser.ParameterDescription
           
 
Method Summary
static
<T> java.lang.String
createUsage(java.lang.Class<T> argProxyInterface)
           
 java.lang.Object invoke(java.lang.Object proxy, java.lang.reflect.Method method, java.lang.Object[] args)
           
static
<T> T
parse(java.lang.String[] args, java.lang.Class<T> argProxyInterface)
           
static
<T> boolean
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
 

Method Detail

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.