|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.zion.jbuddy.bots.BotParameter
public class BotParameter
Asks a user for input.
The user is prompted with the parameter's description. They may then enter a
value for the parameter. The value's expected format depends on the
parameter's type
, as well as any validation
patterns
that may be set.
A user's parameter values may be recalled from within a
BotActionTask
. They may also be referenced by their parameter names
using content variables. For example, the following target asks for user
input, then echos back the values:
Parameters may also be hidden. In this case, a value is explicitly set, and users are not prompted to enter a value.
Constructor Summary | |
---|---|
BotParameter(BotParameterType type,
String name)
Creates a parameter. |
Method Summary | |
---|---|
Object |
clone()
Makes an exact copy of this parameter. |
String |
getCancelCommand()
Returns the cancel command. |
DateFormat |
getDateFormat()
Returns the date format to use. |
BotDateTimeStyle |
getDateStyle()
Returns the date style to use. |
RichContent |
getDescription()
Returns this parameter's description. |
Locale |
getLocale()
Returns the locale to use for this parameter. |
String |
getName()
Returns this parameter's name. |
NumberFormat |
getNumberFormat()
Returns the number format to use. |
BotPatternSet |
getPatterns()
Returns this parameter's validation patterns. |
BotDateTimeStyle |
getTimeStyle()
Returns the time style to use. |
BotParameterType |
getType()
Returns this parameter's type. |
String |
getValue()
Returns this parameter's value. |
boolean |
isHidden()
Returns whether this parameter is hidden. |
void |
setCancelCommand(String cancelCommand)
Sets the cancel command. |
void |
setDateFormat(DateFormat dateFormat)
Sets the date format to use. |
void |
setDateStyle(BotDateTimeStyle dateStyle)
The date style to use. |
void |
setDescription(RichContent description)
Sets this parameter's description. |
void |
setHidden(boolean isHidden)
Sets whether this parameter is hidden. |
void |
setLocale(Locale locale)
Sets the locale to use for this parameter. |
void |
setName(String name)
Sets this parameter's name. |
void |
setNumberFormat(NumberFormat numberFormat)
Sets the number format to use. |
void |
setTimeStyle(BotDateTimeStyle timeStyle)
Sets the time style to use. |
void |
setType(BotParameterType type)
Sets this parameter's type. |
void |
setValue(String value)
Sets this parameter's value. |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public BotParameter(BotParameterType type, String name)
type
- the parameter's typename
- the parameter's nameMethod Detail |
---|
public BotParameterType getType()
public void setType(BotParameterType type)
public String getName()
public void setName(String name)
public RichContent getDescription()
public void setDescription(RichContent description)
This is the message the user is prompted with. If a description is not specified, a reasonable default is used.
public boolean isHidden()
public void setHidden(boolean isHidden)
If true
, users will not be prompted to enter a value for
this parameter.
The default value is false
.
public String getValue()
public void setValue(String value)
If this parameter is hidden, this value is used, and users will not be prompted to enter a value for this parameter. Otherwise, users will be prompted, and this value will be ignored.
This value can contain content variables.
public String getCancelCommand()
public void setCancelCommand(String cancelCommand)
A user can enter this command to cancel the parameter, instead of entering a value. This also cancels further execution of the target or event handler that called this parameter.
The default cancel command is "cancel
".
public BotPatternSet getPatterns()
If any patterns are set, a user value must match at least one of them to be considered valid. If a user value is not valid, the user is sent an error message and prompted again to enter a value.
public Locale getLocale()
public void setLocale(Locale locale)
Affects the accepted values/syntax for number
,
date
, and time
-related parameters.
public NumberFormat getNumberFormat()
public void setNumberFormat(NumberFormat numberFormat)
Valid only for number
, currency
, and
percent
parameters.
public BotDateTimeStyle getDateStyle()
public void setDateStyle(BotDateTimeStyle dateStyle)
public BotDateTimeStyle getTimeStyle()
public void setTimeStyle(BotDateTimeStyle timeStyle)
public DateFormat getDateFormat()
public void setDateFormat(DateFormat dateFormat)
Valid only for date
, time
, and
date-time
parameters.
public Object clone()
clone
in class Object
public String toString()
toString
in class Object
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |