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

public abstract Class DelimitedOptionHandler<T>

extends OptionHandler<T>
Class Inheritance
Known Direct Subclasses
org.kohsuke.args4j.spi.MultiPathOptionHandler, org.kohsuke.args4j.spi.MultiFileOptionHandler
Imports
org.kohsuke.args4j.CmdLineException, .CmdLineParser, .Option, .OptionDef, java.util.List

Partial OptionHandler implementation that takes a single value to the option, which is then gets split into individual tokens using fixed delimiter.

This class is marked as abstract even though it has no abstract methods to indicate that the class cannot be used by itself in Option#handler(), due to the extra argument that it takes.

Author
kmahoney

Field Summary

Modifier and TypeField and Description
protected final String
protected final OneArgumentOptionHandler<? extends T>
Inherited from org.kohsuke.args4j.spi.OptionHandler:
optionownersetter

Constructor Summary

AccessConstructor and Description
public
DelimitedOptionHandler(CmdLineParser parser, OptionDef option, Setter<? super T> setter, String delimiter, OneArgumentOptionHandler<? extends T> individualOptionHandler)

Method Summary

Modifier and TypeMethod and Description
public String
getDefaultMetaVariable()

Implements abstract org.kohsuke.args4j.spi.OptionHandler.getDefaultMetaVariable.

Gets the default meta variable name used to print the usage screen.

public int
parseArguments(Parameters
The rest of the arguments. This method can use this object to access the arguments of the option if necessary. The object is valid only during the method call.
params
)

Implements abstract org.kohsuke.args4j.spi.OptionHandler.parseArguments.

Called if the option that this owner recognizes is found.

public String

Returns:

null if the current value of the setter isn't available.
printDefaultValue
()

Overrides org.kohsuke.args4j.spi.OptionHandler.printDefaultValue.

Prints the default value by introspecting the current setter as Getter.

Inherited from org.kohsuke.args4j.spi.OptionHandler:
getMetaVariablegetNameAndMetagetNameAndMetaprint

Field Detail

delimiterback to summary
protected final String delimiter
individualOptionHandlerback to summary
protected final OneArgumentOptionHandler<? extends T> individualOptionHandler

Constructor Detail

DelimitedOptionHandlerback to summary
public DelimitedOptionHandler(CmdLineParser parser, OptionDef option, Setter<? super T> setter, String delimiter, OneArgumentOptionHandler<? extends T> individualOptionHandler)

Method Detail

getDefaultMetaVariableback to summary
public String getDefaultMetaVariable()

Implements abstract org.kohsuke.args4j.spi.OptionHandler.getDefaultMetaVariable.

Doc from org.kohsuke.args4j.spi.OptionHandler.getDefaultMetaVariable.

Gets the default meta variable name used to print the usage screen. The value returned by this method can be a reference in the ResourceBundle, if one was passed to CmdLineParser.

Returns:String

null to hide a meta variable.

Annotations
@Override
parseArgumentsback to summary
public int parseArguments(Parameters params) throws CmdLineException

Implements abstract org.kohsuke.args4j.spi.OptionHandler.parseArguments.

Doc from org.kohsuke.args4j.spi.OptionHandler.parseArguments.

Called if the option that this owner recognizes is found.

Parameters
params:Parameters

The rest of the arguments. This method can use this object to access the arguments of the option if necessary. The object is valid only during the method call.

Returns:int

The number of arguments consumed. (For example, returns 0 if this option doesn't take any parameters.)

Annotations
@Override
printDefaultValueback to summary
public String printDefaultValue()

Overrides org.kohsuke.args4j.spi.OptionHandler.printDefaultValue.

Prints the default value by introspecting the current setter as Getter.

Returns:String

null if the current value of the setter isn't available.