![]() |
Bukkit
1.5.2-R1.0
|
A ConversationFactory is responsible for creating a Conversation from a predefined template. More...
Collaboration diagram for org.bukkit.conversations.ConversationFactory:Public Member Functions | |
| ConversationFactory (Plugin plugin) | |
| Constructs a ConversationFactory. | |
| ConversationFactory | withModality (boolean modal) |
| Sets the modality of all Conversations created by this factory. | |
| ConversationFactory | withLocalEcho (boolean localEchoEnabled) |
| Sets the local echo status for all Conversations created by this factory. | |
| ConversationFactory | withPrefix (ConversationPrefix prefix) |
| Sets the ConversationPrefix that prepends all output from all generated conversations. | |
| ConversationFactory | withTimeout (int timeoutSeconds) |
| Sets the number of inactive seconds to wait before automatically abandoning all generated conversations. | |
| ConversationFactory | withFirstPrompt (Prompt firstPrompt) |
| Sets the first prompt to use in all generated conversations. | |
| ConversationFactory | withInitialSessionData (Map< Object, Object > initialSessionData) |
| Sets any initial data with which to populate the conversation context sessionData map. | |
| ConversationFactory | withEscapeSequence (String escapeSequence) |
| Sets the player input that, when received, will immediately terminate the conversation. | |
| ConversationFactory | withConversationCanceller (ConversationCanceller canceller) |
| Adds a to constructed conversations. | |
| ConversationFactory | thatExcludesNonPlayersWithMessage (String playerOnlyMessage) |
| Prevents this factory from creating a conversation for non-player Conversable objects. | |
| ConversationFactory | addConversationAbandonedListener (ConversationAbandonedListener listener) |
| Adds a ConversationAbandonedListener to all conversations constructed by this factory. | |
| Conversation | buildConversation (Conversable forWhom) |
| Constructs a Conversation in accordance with the defaults set for this factory. | |
Protected Attributes | |
| Plugin | plugin |
| boolean | isModal |
| boolean | localEchoEnabled |
| ConversationPrefix | prefix |
| Prompt | firstPrompt |
| Map< Object, Object > | initialSessionData |
| String | playerOnlyMessage |
| List< ConversationCanceller > | cancellers |
| List < ConversationAbandonedListener > | abandonedListeners |
A ConversationFactory is responsible for creating a Conversation from a predefined template.
A ConversationFactory is typically created when a plugin is instantiated and builds a Conversation each time a user initiates a conversation with the plugin. Each Conversation maintains its own state and calls back as needed into the plugin.
The ConversationFactory implements a fluid API, allowing parameters to be set as an extension to the constructor.
Definition at line 18 of file ConversationFactory.java.
| org.bukkit.conversations.ConversationFactory.ConversationFactory | ( | Plugin | plugin | ) |
Constructs a ConversationFactory.
| plugin | The plugin that owns the factory. |
Definition at line 34 of file ConversationFactory.java.
References org.bukkit.conversations.ConversationFactory.abandonedListeners, org.bukkit.conversations.ConversationFactory.cancellers, org.bukkit.conversations.Prompt.END_OF_CONVERSATION, org.bukkit.conversations.ConversationFactory.firstPrompt, org.bukkit.conversations.ConversationFactory.initialSessionData, org.bukkit.conversations.ConversationFactory.isModal, org.bukkit.conversations.ConversationFactory.localEchoEnabled, org.bukkit.conversations.ConversationFactory.playerOnlyMessage, org.bukkit.conversations.ConversationFactory.plugin, and org.bukkit.conversations.ConversationFactory.prefix.
| ConversationFactory org.bukkit.conversations.ConversationFactory.addConversationAbandonedListener | ( | ConversationAbandonedListener | listener | ) |
Adds a ConversationAbandonedListener to all conversations constructed by this factory.
| listener | The listener to add. |
Definition at line 152 of file ConversationFactory.java.
References org.bukkit.conversations.ConversationFactory.abandonedListeners.
| Conversation org.bukkit.conversations.ConversationFactory.buildConversation | ( | Conversable | forWhom | ) |
Constructs a Conversation in accordance with the defaults set for this factory.
| forWhom | The entity for whom the new conversation is mediating. |
Definition at line 162 of file ConversationFactory.java.
References org.bukkit.conversations.ConversationFactory.abandonedListeners, org.bukkit.conversations.Conversation.addConversationAbandonedListener(), org.bukkit.conversations.ConversationFactory.cancellers, org.bukkit.conversations.ConversationFactory.firstPrompt, org.bukkit.conversations.ConversationFactory.initialSessionData, org.bukkit.conversations.ConversationFactory.isModal, org.bukkit.conversations.ConversationFactory.localEchoEnabled, org.bukkit.conversations.ConversationFactory.playerOnlyMessage, org.bukkit.conversations.ConversationFactory.plugin, org.bukkit.conversations.ConversationFactory.prefix, and org.bukkit.conversations.Conversation.setLocalEchoEnabled().
| ConversationFactory org.bukkit.conversations.ConversationFactory.thatExcludesNonPlayersWithMessage | ( | String | playerOnlyMessage | ) |
Prevents this factory from creating a conversation for non-player Conversable objects.
| playerOnlyMessage | The message to return to a non-play in lieu of starting a conversation. |
Definition at line 142 of file ConversationFactory.java.
References org.bukkit.conversations.ConversationFactory.playerOnlyMessage.
| ConversationFactory org.bukkit.conversations.ConversationFactory.withConversationCanceller | ( | ConversationCanceller | canceller | ) |
Adds a to constructed conversations.
}
| canceller | The to add. |
Definition at line 132 of file ConversationFactory.java.
References org.bukkit.conversations.ConversationFactory.cancellers.
Referenced by org.bukkit.conversations.ConversationFactory.withEscapeSequence(), and org.bukkit.conversations.ConversationFactory.withTimeout().
| ConversationFactory org.bukkit.conversations.ConversationFactory.withEscapeSequence | ( | String | escapeSequence | ) |
Sets the player input that, when received, will immediately terminate the conversation.
| escapeSequence | Input to terminate the conversation. |
Definition at line 122 of file ConversationFactory.java.
References org.bukkit.conversations.ConversationFactory.withConversationCanceller().
| ConversationFactory org.bukkit.conversations.ConversationFactory.withFirstPrompt | ( | Prompt | firstPrompt | ) |
Sets the first prompt to use in all generated conversations.
The default is Prompt.END_OF_CONVERSATION.
| firstPrompt | The first prompt. |
Definition at line 102 of file ConversationFactory.java.
References org.bukkit.conversations.ConversationFactory.firstPrompt.
| ConversationFactory org.bukkit.conversations.ConversationFactory.withInitialSessionData | ( | Map< Object, Object > | initialSessionData | ) |
Sets any initial data with which to populate the conversation context sessionData map.
| initialSessionData | The conversation context's initial sessionData. |
Definition at line 112 of file ConversationFactory.java.
References org.bukkit.conversations.ConversationFactory.initialSessionData.
| ConversationFactory org.bukkit.conversations.ConversationFactory.withLocalEcho | ( | boolean | localEchoEnabled | ) |
Sets the local echo status for all Conversations created by this factory.
If local echo is enabled, any text submitted to a conversation gets echoed back into the submitter's chat window.
| localEchoEnabled | The status of local echo. |
Definition at line 67 of file ConversationFactory.java.
References org.bukkit.conversations.ConversationFactory.localEchoEnabled.
| ConversationFactory org.bukkit.conversations.ConversationFactory.withModality | ( | boolean | modal | ) |
Sets the modality of all Conversations created by this factory.
If a conversation is modal, all messages directed to the player are suppressed for the duration of the conversation.
The default is True.
| modal | The modality of all conversations to be created. |
Definition at line 55 of file ConversationFactory.java.
References org.bukkit.conversations.ConversationFactory.isModal.
| ConversationFactory org.bukkit.conversations.ConversationFactory.withPrefix | ( | ConversationPrefix | prefix | ) |
Sets the ConversationPrefix that prepends all output from all generated conversations.
The default is a NullConversationPrefix;
| prefix | The ConversationPrefix to use. |
Definition at line 79 of file ConversationFactory.java.
References org.bukkit.conversations.ConversationFactory.prefix.
| ConversationFactory org.bukkit.conversations.ConversationFactory.withTimeout | ( | int | timeoutSeconds | ) |
Sets the number of inactive seconds to wait before automatically abandoning all generated conversations.
The default is 600 seconds (5 minutes).
| timeoutSeconds | The number of seconds to wait. |
Definition at line 91 of file ConversationFactory.java.
References org.bukkit.conversations.ConversationFactory.plugin, and org.bukkit.conversations.ConversationFactory.withConversationCanceller().
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |