|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sun.slamd.parameter.Parameter
com.sun.slamd.parameter.MultiValuedParameter
This class defines a parameter that may have multiple concurrent values. The HTML input form will be a list box that allows multiple values to be selected at the same time. The internal representation of the value of this parameter will be an integer, with the individual values each associated with an increasing power of 2 (the first item will be associated with a value of 1, the second with a value of 2, the third with 4, the fourth with 8, etc.). Anything that uses this parameter type must maintain that mapping externally because the value strings are not included in the encoded version of this parameter that is sent between the client and server.
| Field Summary |
| Fields inherited from class com.sun.slamd.parameter.Parameter |
description, displayName, isRequired, name, value |
| Constructor Summary | |
MultiValuedParameter()
Creates a new instance of the Parameter to be used when decoding values transported over the network, and should not be used by jobs to create parameters. |
|
MultiValuedParameter(java.lang.String name,
java.lang.String[] valueStrings)
Creates a new multivalued parameter with the specified name and set of potential values. |
|
MultiValuedParameter(java.lang.String name,
java.lang.String[] valueStrings,
boolean isRequired)
Creates a new multivalued parameter with the specified name, set of potential values, and required/optional indicator. |
|
MultiValuedParameter(java.lang.String name,
java.lang.String displayName,
java.lang.String[] valueStrings)
Creates a new multivalued parameter with the specified name, display name, and set of potential values. |
|
MultiValuedParameter(java.lang.String name,
java.lang.String displayName,
java.lang.String[] valueStrings,
boolean isRequired)
Creates a new multivalued parameter with the specified name, display name, set of potential values, and required/optional indicator. |
|
MultiValuedParameter(java.lang.String name,
java.lang.String displayName,
java.lang.String description,
java.lang.String[] valueStrings)
Creates a new multivalued parameter with the specified name, display name, description, and set of potential values. |
|
MultiValuedParameter(java.lang.String name,
java.lang.String displayName,
java.lang.String description,
java.lang.String[] valueStrings,
boolean isRequired)
Creates a new multivalued parameter with the specified name, display name, description, set of potential values, and required/optional indicator. |
|
MultiValuedParameter(java.lang.String name,
java.lang.String displayName,
java.lang.String description,
java.lang.String[] valueStrings,
int intValue)
Creates a new multivalued parameter with the specified name, display name, description, set of potential values, and set of selected values. |
|
MultiValuedParameter(java.lang.String name,
java.lang.String displayName,
java.lang.String description,
java.lang.String[] valueStrings,
int intValue,
boolean isRequired)
Creates a new multivalued parameter with the specified name, display name, description, set of potential values, set of selected values, and required/optional indicator. |
|
| Method Summary | |
java.lang.Object |
clone()
Creates a new multivalued parameter that is a duplicate of this parameter. |
java.lang.String |
getDisplayValue()
Retrieves a string representation of the value of this parameter. |
java.lang.String |
getHTMLDisplayValue()
Retrieves the value of this parameter in a form that can be displayed in an HTML document. |
java.lang.String |
getHTMLInputForm(java.lang.String prefix)
Retrieves an HTML string that can be used to specify the value(s) for this parameter. |
int |
getIntValue()
Retrieves the integer value that specifies which of the potential values are actually selected. |
java.lang.String |
getInvalidReason(java.lang.Object value)
Retrieves a string that indicates why the provided value is invalid. |
int |
getMaxValue()
Retrieves the maximum allowed value for this parameter based on the number of items in the set of potential values. |
java.lang.String |
getValueString()
Retrieves a string representation of the value of this parameter. |
java.lang.String[] |
getValueStrings()
Retrieves the set of value strings that may be used with this parameter (i.e., the potential values). |
int |
getVisibleRows()
Retrieves the maximum number of rows that will be visible when displaying the HTML input form. |
boolean |
hasValue()
Indicates whether this parameter has one or more values. |
void |
htmlInputFormToValue(java.lang.String[] values)
Specifies the value of this parameter based on the provided text that would be returned from posting an HTML form. |
int |
indexToIntValue(int valueIndex)
Provides a mapping between the position of an element in the set of value strings to the numeric value associated with the element in that position. |
boolean |
isSelected(int optionValue)
Indicates whether the option associated with the specified value is selected. |
void |
setValue(int intValue)
Specifies the integer value to use for this parameter. |
void |
setValue(java.lang.Object value)
Specifies the value to use for this parameter. |
void |
setValueFrom(Parameter parameter)
Sets the value for this parameter from the information in the provided parameter. |
void |
setValueFromString(java.lang.String valueString)
Specifies the value to use for this parameter from the provided String. |
void |
setVisibleRows(int visibleRows)
Specifies the maximum number of rows that will be visible when displaying the HTML input form. |
| Methods inherited from class com.sun.slamd.parameter.Parameter |
decode, encode, getDescription, getDisplayName, getHTMLPostValue, getInvalidReason, getName, getValue, isRequired, isValid, isValid, setDescription, setDisplayName, setName, setRequired, toString |
| Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public MultiValuedParameter()
setName, setDisplayName,
setDescription, or setValueFromString, then it
should be done here.
public MultiValuedParameter(java.lang.String name,
java.lang.String[] valueStrings)
name - The name to use for this parameter.valueStrings - The text associated with the potential values of this
parameter.
public MultiValuedParameter(java.lang.String name,
java.lang.String[] valueStrings,
boolean isRequired)
name - The name to use for this parameter.valueStrings - The text associated with the potential values of this
parameter.isRequired - Indicates whether this parameter is required to
have a value.
public MultiValuedParameter(java.lang.String name,
java.lang.String displayName,
java.lang.String[] valueStrings)
name - The name to use for this parameter.displayName - The display name to use for this parameter.valueStrings - The text associated with the potential values of this
parameter.
public MultiValuedParameter(java.lang.String name,
java.lang.String displayName,
java.lang.String[] valueStrings,
boolean isRequired)
name - The name to use for this parameter.displayName - The display name to use for this parameter.valueStrings - The text associated with the potential values of this
parameter.isRequired - Indicates whether this parameter is required to
have a value.
public MultiValuedParameter(java.lang.String name,
java.lang.String displayName,
java.lang.String description,
java.lang.String[] valueStrings)
name - The name to use for this parameter.displayName - The display name to use for this parameter.description - The description to use for this parameter.valueStrings - The text associated with the potential values of this
parameter.
public MultiValuedParameter(java.lang.String name,
java.lang.String displayName,
java.lang.String description,
java.lang.String[] valueStrings,
boolean isRequired)
name - The name to use for this parameter.displayName - The display name to use for this parameter.description - The description to use for this parameter.valueStrings - The text associated with the potential values of this
parameter.isRequired - Indicates whether this parameter is required to
have a value.
public MultiValuedParameter(java.lang.String name,
java.lang.String displayName,
java.lang.String description,
java.lang.String[] valueStrings,
int intValue)
name - The name to use for this parameter.displayName - The display name to use for this parameter.description - The description to use for this parameter.valueStrings - The text associated with the potential values of this
parameter.intValue - The numeric representation that indicates which of
the values are selected.
public MultiValuedParameter(java.lang.String name,
java.lang.String displayName,
java.lang.String description,
java.lang.String[] valueStrings,
int intValue,
boolean isRequired)
name - The name to use for this parameter.displayName - The display name to use for this parameter.description - The description to use for this parameter.valueStrings - The text associated with the potential values of this
parameter.intValue - The numeric representation that indicates which of
the values are selected.isRequired - Indicates whether this parameter is required to
have a value.| Method Detail |
public java.lang.String[] getValueStrings()
public int getIntValue()
public boolean isSelected(int optionValue)
optionValue - The numeric value of the option for which to make the
determination.
true if the specified value is selected, or
false if it is not.
public void setValue(int intValue)
throws InvalidValueException
intValue - The integer value to use for this parameter.
InvalidValueException - If there is a problem with the value
information provided.
public void setValue(java.lang.Object value)
throws InvalidValueException
setValue in class Parametervalue - The value to use for this parameter.
InvalidValueException - If the value provided is not valid.public void setValueFrom(Parameter parameter)
setValueFrom in class Parameterparameter - The parameter from which to take the value for this
parameter.public int getVisibleRows()
public void setVisibleRows(int visibleRows)
visibleRows - The maximum number of rows that will be visible when
displaying the HTML input form.public java.lang.String getValueString()
getValueString in class Parameter
public void setValueFromString(java.lang.String valueString)
throws InvalidValueException
setValueFromString in class ParametervalueString - The string representation of the value to use for this
parameter.
InvalidValueException - If the provided value cannot be used to
provide a value for this parameter.public java.lang.String getInvalidReason(java.lang.Object value)
getInvalidReason in class Parametervalue - The value for which to obtain the invalid reason.
null if the value is valid.public boolean hasValue()
hasValue in class Parametertrue if this parameter has one or more values, or
false if not.public java.lang.String getDisplayValue()
getDisplayValue in class Parameterpublic java.lang.String getHTMLDisplayValue()
getHTMLDisplayValue in class Parameterpublic java.lang.String getHTMLInputForm(java.lang.String prefix)
getHTMLInputForm in class Parameterprefix - The prefix that should be placed in front of the parameter
name as the name of the form element.
public void htmlInputFormToValue(java.lang.String[] values)
throws InvalidValueException
htmlInputFormToValue in class Parametervalues - The set of values for this parameter contained in the
servlet request.
InvalidValueException - If the specified value is not acceptable
for this parameter.public java.lang.Object clone()
clone in class Parameterpublic int indexToIntValue(int valueIndex)
valueIndex - The position of the item in the set of value strings.
public int getMaxValue()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||