![]() |
Bukkit
1.4.7-R1.0
|
ValidatingPrompt is the base class for any prompt that requires validation. More...
Inheritance diagram for org.bukkit.conversations.ValidatingPrompt:
Collaboration diagram for org.bukkit.conversations.ValidatingPrompt:Public Member Functions | |
| ValidatingPrompt () | |
| Prompt | acceptInput (ConversationContext context, String input) |
| Accepts and processes input from the user and validates it. | |
| boolean | blocksForInput (ConversationContext context) |
| Ensures that the prompt waits for the user to provide input. | |
Public Member Functions inherited from org.bukkit.conversations.Prompt | |
| String | getPromptText (ConversationContext context) |
| Gets the text to display to the user when this prompt is first presented. | |
| boolean | blocksForInput (ConversationContext context) |
| Checks to see if this prompt implementation should wait for user input or immediately display the next prompt. | |
| Prompt | acceptInput (ConversationContext context, String input) |
| Accepts and processes input from the user. | |
Protected Member Functions | |
| abstract boolean | isInputValid (ConversationContext context, String input) |
| Override this method to check the validity of the player's input. | |
| abstract Prompt | acceptValidatedInput (ConversationContext context, String input) |
| Override this method to accept and processes the validated input from the user. | |
| String | getFailedValidationText (ConversationContext context, String invalidInput) |
| Optionally override this method to display an additional message if the user enters an invalid input. | |
Additional Inherited Members | |
Static Public Attributes inherited from org.bukkit.conversations.Prompt | |
| static final Prompt | END_OF_CONVERSATION = null |
| A convenience constant for indicating the end of a conversation. | |
ValidatingPrompt is the base class for any prompt that requires validation.
ValidatingPrompt will keep replaying the prompt text until the user enters a valid response.
Definition at line 9 of file ValidatingPrompt.java.
| org.bukkit.conversations.ValidatingPrompt.ValidatingPrompt | ( | ) |
Definition at line 10 of file ValidatingPrompt.java.
| Prompt org.bukkit.conversations.ValidatingPrompt.acceptInput | ( | ConversationContext | context, |
| String | input | ||
| ) |
Accepts and processes input from the user and validates it.
If validation fails, this prompt is returned for re-execution, otherwise the next Prompt in the prompt graph is returned.
| context | Context information about the conversation. |
| input | The input text from the user. |
Definition at line 21 of file ValidatingPrompt.java.
References org.bukkit.conversations.ValidatingPrompt.acceptValidatedInput(), org.bukkit.conversations.ValidatingPrompt.getFailedValidationText(), org.bukkit.conversations.ConversationContext.getForWhom(), org.bukkit.conversations.ValidatingPrompt.isInputValid(), org.bukkit.ChatColor.RED, and org.bukkit.conversations.Conversable.sendRawMessage().
|
protectedpure virtual |
Override this method to accept and processes the validated input from the user.
Using the input, the next Prompt in the prompt graph should be returned.
| context | Context information about the conversation. |
| input | The validated input text from the user. |
Implemented in org.bukkit.conversations.NumericPrompt, org.bukkit.conversations.PlayerNamePrompt, and org.bukkit.conversations.BooleanPrompt.
Referenced by org.bukkit.conversations.ValidatingPrompt.acceptInput().
| boolean org.bukkit.conversations.ValidatingPrompt.blocksForInput | ( | ConversationContext | context | ) |
Ensures that the prompt waits for the user to provide input.
| context | Context information about the conversation. |
Definition at line 39 of file ValidatingPrompt.java.
|
protected |
Optionally override this method to display an additional message if the user enters an invalid input.
| context | Context information about the conversation. |
| invalidInput | The invalid input provided by the user. |
Definition at line 66 of file ValidatingPrompt.java.
Referenced by org.bukkit.conversations.ValidatingPrompt.acceptInput().
|
protectedpure virtual |
Override this method to check the validity of the player's input.
| context | Context information about the conversation. |
| input | The player's raw console input. |
Implemented in org.bukkit.conversations.FixedSetPrompt, org.bukkit.conversations.RegexPrompt, org.bukkit.conversations.PlayerNamePrompt, org.bukkit.conversations.BooleanPrompt, and org.bukkit.conversations.NumericPrompt.
Referenced by org.bukkit.conversations.ValidatingPrompt.acceptInput().