|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.commons.cli2.builder.ArgumentBuilder
public class ArgumentBuilder
Builds Argument instances.
Field Summary | |
---|---|
private java.lang.String |
consumeRemaining
used to identify the consume remaining option, typically "--" |
private java.util.List |
defaultValues
default values for argument |
private java.lang.String |
description
description of the argument. |
private int |
id
id of the argument |
private char |
initialSeparator
character used to separate the values from the option |
private int |
maximum
maximum number of values permitted |
private int |
minimum
minimum number of values required |
private java.lang.String |
name
name of the argument. |
private static ResourceHelper |
resources
i18n |
private char |
subsequentSeparator
character used to separate the values from each other |
private Validator |
validator
object that should be used to ensure the values are valid |
Constructor Summary | |
---|---|
ArgumentBuilder()
Creates a new ArgumentBuilder instance |
Method Summary | |
---|---|
Argument |
create()
Creates a new Argument instance using the options specified in this ArgumentBuilder. |
ArgumentBuilder |
reset()
Resets the ArgumentBuilder to the defaults for a new Argument. |
ArgumentBuilder |
withConsumeRemaining(java.lang.String newConsumeRemaining)
Sets the "consume remaining" option, defaults to "--". |
ArgumentBuilder |
withDefault(java.lang.Object defaultValue)
Sets the default value. |
ArgumentBuilder |
withDefaults(java.util.List newDefaultValues)
Sets the default values. |
ArgumentBuilder |
withDescription(java.lang.String newDescription)
Sets the description of the argument. |
ArgumentBuilder |
withId(int newId)
Sets the id |
ArgumentBuilder |
withInitialSeparator(char newInitialSeparator)
Sets the character used to separate the values from the option. |
ArgumentBuilder |
withMaximum(int newMaximum)
Sets the maximum number of values allowed for the argument to be valid. |
ArgumentBuilder |
withMinimum(int newMinimum)
Sets the minimum number of values needed for the argument to be valid. |
ArgumentBuilder |
withName(java.lang.String newName)
Sets the name of the argument. |
ArgumentBuilder |
withSubsequentSeparator(char newSubsequentSeparator)
Sets the character used to separate the values from each other. |
ArgumentBuilder |
withValidator(Validator newValidator)
Sets the validator instance used to perform validation on the Argument values. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final ResourceHelper resources
private java.lang.String name
private java.lang.String description
private int minimum
private int maximum
private char initialSeparator
private char subsequentSeparator
private Validator validator
private java.lang.String consumeRemaining
private java.util.List defaultValues
private int id
Constructor Detail |
---|
public ArgumentBuilder()
Method Detail |
---|
public final Argument create()
public final ArgumentBuilder reset()
public final ArgumentBuilder withName(java.lang.String newName)
newName
- the name of the argument
CommandLine.getValue(String)
public final ArgumentBuilder withDescription(java.lang.String newDescription)
newDescription
- a description of the argument
public final ArgumentBuilder withMinimum(int newMinimum)
newMinimum
- the number of values needed
public final ArgumentBuilder withMaximum(int newMaximum)
newMaximum
- the number of values allowed
public final ArgumentBuilder withInitialSeparator(char newInitialSeparator)
newInitialSeparator
- the character used to separate the values
from the option
public final ArgumentBuilder withSubsequentSeparator(char newSubsequentSeparator)
newSubsequentSeparator
- the character used to separate the values
from each other
public final ArgumentBuilder withValidator(Validator newValidator)
newValidator
- a Validator instance
public final ArgumentBuilder withConsumeRemaining(java.lang.String newConsumeRemaining)
newConsumeRemaining
- the string to use for the consume
remaining option
public final ArgumentBuilder withDefault(java.lang.Object defaultValue)
defaultValue
- the default value for the Argument
public final ArgumentBuilder withDefaults(java.util.List newDefaultValues)
newDefaultValues
- the default values for the Argument
public final ArgumentBuilder withId(int newId)
newId
- the id of the Argument
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |