|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.opends.server.util.args.Argument
org.opends.server.util.args.MultiChoiceArgument
public class MultiChoiceArgument
This class defines an argument type that will only accept one or more of a specific set of string values.
| Constructor Summary | |
|---|---|
MultiChoiceArgument(java.lang.String name,
java.lang.Character shortIdentifier,
java.lang.String longIdentifier,
boolean isRequired,
boolean isMultiValued,
boolean needsValue,
Message valuePlaceholder,
java.lang.String defaultValue,
java.lang.String propertyName,
java.util.HashSet<java.lang.String> allowedValues,
boolean caseSensitive,
Message description)
Creates a new string argument with the provided information. |
|
MultiChoiceArgument(java.lang.String name,
java.lang.Character shortIdentifier,
java.lang.String longIdentifier,
boolean isRequired,
boolean needsValue,
Message valuePlaceholder,
java.util.HashSet<java.lang.String> allowedValues,
boolean caseSensitive,
Message description)
Creates a new string argument with the provided information. |
|
| Method Summary | |
|---|---|
java.util.HashSet<java.lang.String> |
getAllowedValues()
Retrieves the set of allowed values for this argument. |
boolean |
isCaseSensitive()
Indicates whether the set of allowed values for this argument should be treated in a case-sensitive manner. |
boolean |
valueIsAcceptable(java.lang.String valueString,
MessageBuilder invalidReason)
Indicates whether the provided value is acceptable for use in this argument. |
| Methods inherited from class org.opends.server.util.args.Argument |
|---|
addValue, clearValues, getBooleanValue, getDefaultValue, getDescription, getIntValue, getIntValues, getLongIdentifier, getName, getPropertyName, getShortIdentifier, getValue, getValuePlaceholder, getValues, hasValue, isHidden, isMultiValued, isPresent, isRequired, isValueSetByProperty, needsValue, setDefaultValue, setHidden, setMultiValued, setNeedsValue, setPresent, setPropertyName, setRequired, setValuePlaceholder, setValueSetByProperty |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public MultiChoiceArgument(java.lang.String name,
java.lang.Character shortIdentifier,
java.lang.String longIdentifier,
boolean isRequired,
boolean needsValue,
Message valuePlaceholder,
java.util.HashSet<java.lang.String> allowedValues,
boolean caseSensitive,
Message description)
throws ArgumentException
name - The generic name that should be used to refer to
this argument.shortIdentifier - The single-character identifier for this
argument, or null if there is none.longIdentifier - The long identifier for this argument, or
null if there is none.isRequired - Indicates whether this argument must be specified
on the command line.needsValue - Indicates whether this argument requires a value.valuePlaceholder - The placeholder for the argument value that will
be displayed in usage information, or
null if this argument does not
require a value.allowedValues - The set of values that are allowed for use for
this argument. If they are not to be treated in
a case-sensitive value then they should all be
formatted in lowercase.caseSensitive - Indicates whether the set of allowed values
should be treated in a case-sensitive manner.description - Message for the description of this
argument.
ArgumentException - If there is a problem with any of the
parameters used to create this argument.
public MultiChoiceArgument(java.lang.String name,
java.lang.Character shortIdentifier,
java.lang.String longIdentifier,
boolean isRequired,
boolean isMultiValued,
boolean needsValue,
Message valuePlaceholder,
java.lang.String defaultValue,
java.lang.String propertyName,
java.util.HashSet<java.lang.String> allowedValues,
boolean caseSensitive,
Message description)
throws ArgumentException
name - The generic name that should be used to refer to
this argument.shortIdentifier - The single-character identifier for this
argument, or null if there is none.longIdentifier - The long identifier for this argument, or
null if there is none.isRequired - Indicates whether this argument must be specified
on the command line.isMultiValued - Indicates whether this argument may be specified
more than once to provide multiple values.needsValue - Indicates whether this argument requires a value.valuePlaceholder - The placeholder for the argument value that will
be displayed in usage information, or
null if this argument does not
require a value.defaultValue - The default value that should be used for this
argument if none is provided in a properties file
or on the command line. This may be
null if there is no generic default.propertyName - The name of the property in a property file that
may be used to override the default value but
will be overridden by a command-line argument.allowedValues - The set of values that are allowed for use for
this argument. If they are not to be treated in
a case-sensitive value then they should all be
formatted in lowercase.caseSensitive - Indicates whether the set of allowed values
should be treated in a case-sensitive manner.description - Message for the description of this
argument.
ArgumentException - If there is a problem with any of the
parameters used to create this argument.| Method Detail |
|---|
public java.util.HashSet<java.lang.String> getAllowedValues()
public boolean isCaseSensitive()
true if the values are to be treated in a
case-sensitive manner, or false if not.
public boolean valueIsAcceptable(java.lang.String valueString,
MessageBuilder invalidReason)
valueIsAcceptable in class ArgumentvalueString - The value for which to make the determination.invalidReason - A buffer into which the invalid reason may be
written if the value is not acceptable.
true if the value is acceptable, or
false if it is not.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||