|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.bukkit.conversations.ValidatingPrompt
public abstract class ValidatingPrompt
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.
| Field Summary |
|---|
| Fields inherited from interface org.bukkit.conversations.Prompt |
|---|
END_OF_CONVERSATION |
| Constructor Summary | |
|---|---|
ValidatingPrompt()
|
|
| Method Summary | |
|---|---|
Prompt |
acceptInput(ConversationContext context,
String input)
Accepts and processes input from the user and validates it. |
protected abstract Prompt |
acceptValidatedInput(ConversationContext context,
String input)
Override this method to accept and processes the validated input from the user. |
boolean |
blocksForInput(ConversationContext context)
Ensures that the prompt waits for the user to provide input. |
protected String |
getFailedValidationText(ConversationContext context,
String invalidInput)
Optionally override this method to display an additional message if the user enters an invalid input. |
protected abstract boolean |
isInputValid(ConversationContext context,
String input)
Override this method to check the validity of the player's input. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.bukkit.conversations.Prompt |
|---|
getPromptText |
| Constructor Detail |
|---|
public ValidatingPrompt()
| Method Detail |
|---|
public Prompt acceptInput(ConversationContext context,
String input)
acceptInput in interface Promptcontext - Context information about the conversation.input - The input text from the user.
public boolean blocksForInput(ConversationContext context)
blocksForInput in interface Promptcontext - Context information about the conversation.
protected abstract boolean isInputValid(ConversationContext context,
String input)
context - Context information about the conversation.input - The player's raw console input.
protected abstract Prompt acceptValidatedInput(ConversationContext context,
String input)
context - Context information about the conversation.input - The validated input text from the user.
protected String getFailedValidationText(ConversationContext context,
String invalidInput)
context - Context information about the conversation.invalidInput - The invalid input provided by the user.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||