org.wymiwyg.commons.util.arguments
Class ArgumentHandler

java.lang.Object
  extended by org.wymiwyg.commons.util.arguments.ArgumentHandler

public class ArgumentHandler
extends Object

Author:
reto

Constructor Summary
ArgumentHandler(String[] arguments)
           
 
Method Summary
<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)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ArgumentHandler

public ArgumentHandler(String[] arguments)
Method Detail

processArguments

public void processArguments(ArgumentProcessor processor)
                      throws InvalidArgumentsException
Throws:
InvalidArgumentsException

getInstance

public <I> I getInstance(Class<I> interfaceClass)
              throws InvalidArgumentsException
This methods uses 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.

Type Parameters:
I - the type of the interface
Parameters:
interfaceClass - a class instance for I, i.e. I.class
Returns:
an object of type I
Throws:
InvalidArgumentsException - thrown when the argument-list doesn't match the definition in the interface annotations


Copyright © 2011. All Rights Reserved.