uk.co.flamingpenguin.jewel.cli
Class CliFactory

java.lang.Object
  extended by uk.co.flamingpenguin.jewel.cli.CliFactory

public abstract class CliFactory
extends java.lang.Object

Constructs a Cli from an annotated interface definition.

Author:
Tim Wood
See Also:
Option

Constructor Summary
CliFactory()
           
 
Method Summary
static
<O> Cli<O>
createCli(java.lang.Class<O> klass)
          Construct a Cli from an annotated interface definition
static
<O> O
parseArguments(java.lang.Class<O> klass, java.lang.String... arguments)
          Parse arguments from an annotated interface definition
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CliFactory

public CliFactory()
Method Detail

createCli

public static <O> Cli<O> createCli(java.lang.Class<O> klass)
Construct a Cli from an annotated interface definition

Type Parameters:
O - The type of the interface that will be used to present the arguments
Parameters:
klass - The annotated interface definition
Returns:
A Cli configured to create instance of klass

parseArguments

public static <O> O parseArguments(java.lang.Class<O> klass,
                                   java.lang.String... arguments)
                        throws ArgumentValidationException
Parse arguments from an annotated interface definition

Type Parameters:
O - The type of the interface that will be used to present the argments
Parameters:
klass - The annotated interface definition
arguments -
Returns:
The parsed arguments
Throws:
InvalidArgumentsException
ArgumentValidationException


Copyright © 2006-2009 flamingpenguin. All Rights Reserved.