com.twitter.common.args.apt
Class Configuration

java.lang.Object
  extended by com.twitter.common.args.apt.Configuration

public class Configuration
extends Object

Loads and stores @CmdLine configuration data.


Nested Class Summary
static class Configuration.ArgInfo
           
static class Configuration.ConfigurationException
          Indicates a problem reading stored @CmdLine arg configuration data.
static class Configuration.ParserInfo
           
static class Configuration.VerifierInfo
           
 
Method Summary
 boolean isEmpty()
           
static Configuration load()
          Loads the @CmdLine argument configuration data stored in the classpath.
 Iterable<Configuration.ArgInfo> optionInfo()
          Returns the field info for all the @CmdLine annotated fields on the classpath.
 Iterable<Configuration.ParserInfo> parserInfo()
          Returns the parser info for all the @ArgParser annotated parsers on the classpath.
 Iterable<Configuration.ArgInfo> positionalInfo()
          Returns the field info for the sole @Positional annotated field on the classpath, if any.
 Iterable<Configuration.VerifierInfo> verifierInfo()
          Returns the verifier info for all the @VerifierFor annotated verifiers on the classpath.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

load

public static Configuration load()
                          throws Configuration.ConfigurationException,
                                 IOException
Loads the @CmdLine argument configuration data stored in the classpath.

Returns:
The @CmdLine argument configuration materialized from the classpath.
Throws:
Configuration.ConfigurationException - if any configuration data is malformed.
IOException - if the configuration data can not be read from the classpath.

isEmpty

public boolean isEmpty()

positionalInfo

public Iterable<Configuration.ArgInfo> positionalInfo()
Returns the field info for the sole @Positional annotated field on the classpath, if any.

Returns:
The field info for the @Positional annotated field if any.

optionInfo

public Iterable<Configuration.ArgInfo> optionInfo()
Returns the field info for all the @CmdLine annotated fields on the classpath.

Returns:
The field info for all the @CmdLine annotated fields.

parserInfo

public Iterable<Configuration.ParserInfo> parserInfo()
Returns the parser info for all the @ArgParser annotated parsers on the classpath.

Returns:
The parser info for all the @ArgParser annotated parsers.

verifierInfo

public Iterable<Configuration.VerifierInfo> verifierInfo()
Returns the verifier info for all the @VerifierFor annotated verifiers on the classpath.

Returns:
The verifier info for all the @VerifierFor annotated verifiers.