Top Description Fields Constructors Methods
org.kohsuke.args4j.spi

public Class OptionImpl

extends AnnotationImpl
implements Option
Class Inheritance
All Implemented Interfaces
org.kohsuke.args4j.Option, java.lang.annotation.Annotation
Imports
org.kohsuke.args4j.Option

Implementation of @Option so we can instantiate it.
Author
Jan Materne

Field Summary

Modifier and TypeField and Description
public String[]
public String[]
public String
Inherited from org.kohsuke.args4j.spi.AnnotationImpl:
aliaseshandlerhelphiddenindexmetaVarmultiValuedrequiredusage

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public String[]
depends()

Implements org.kohsuke.args4j.Option.depends.

List of other options that this option depends on.

public String[]
forbids()

Implements org.kohsuke.args4j.Option.forbids.

List of other options that this option is incompatible with..

public String
name()

Implements org.kohsuke.args4j.Option.name.

Name of the option, such as -foo or -bar.

Inherited from org.kohsuke.args4j.spi.AnnotationImpl:
aliasesannotationTypehandlerhelphiddenindexmetaVarmultiValuedrequiredusage

Field Detail

dependsback to summary
public String[] depends
forbidsback to summary
public String[] forbids
nameback to summary
public String name

Constructor Detail

OptionImplback to summary
public OptionImpl(ConfigElement ce) throws ClassNotFoundException

Method Detail

dependsback to summary
public String[] depends()

Implements org.kohsuke.args4j.Option.depends.

Doc from org.kohsuke.args4j.Option.depends.

List of other options that this option depends on.

Example

 @Option(name="-a")
 int a;
 //-b is not required but if it's provided, then a becomes required
 @Option(name="-b", depends={"-a"})
 int b;

At the end of CmdLineParser#parseArgument(String...), a CmdLineException will be thrown if options required by another one are not present.

forbidsback to summary
public String[] forbids()

Implements org.kohsuke.args4j.Option.forbids.

Doc from org.kohsuke.args4j.Option.forbids.

List of other options that this option is incompatible with..

Example

 @Option(name="-a")
 int a;
 // -h and -a cannot be specified together
 @Option(name="-h", forbids={"-a"})
 boolean h;

At the end of CmdLineParser#parseArgument(String...), a CmdLineException will be thrown if forbidden option combinations are present.

nameback to summary
public String name()

Implements org.kohsuke.args4j.Option.name.

Doc from org.kohsuke.args4j.Option.name.

Name of the option, such as -foo or -bar.