public interface EventHandler extends EventSubscriber
ImplementationPlatform and propagated via
the EventBus.
When an event is thrown, the scope in which the event is handled and its enclosing scopes are examined to find the best qualified catch element, according to the following algorithm:
cond evaluates to false after conversion
to boolean.
The name of a thrown event matches the catch element event name if it is an exact match, a prefix match or if the catch event attribute is not specified (note that the event attribute cannot be specified as an empty string - event="" is syntactically invalid). A prefix match occurs when the catch element event attribute is a token prefix of the name of the event being thrown, where the dot is the token separator, all trailing dots are removed, and a remaining empty string matches everything.
ImplementationPlatform| Modifier and Type | Method and Description |
|---|---|
boolean |
addStrategy(EventStrategy strategy)
Adds a strategy for the given event type.
|
void |
clean(FormItem item)
Removes all event handlers that were collected for the given form item.
|
void |
clearEvent()
Removes all cached events that have been received.
|
void |
collect(VoiceXmlInterpreterContext context,
VoiceXmlInterpreter interpreter,
Dialog dialog)
Adds all event handlers defined in the given dialog.
|
java.util.Collection<EventStrategy> |
collect(VoiceXmlInterpreterContext context,
VoiceXmlInterpreter interpreter,
FormInterpretationAlgorithm fia,
CatchContainer item)
Adds all event handlers defined in the given input item.
|
void |
collect(VoiceXmlInterpreterContext context,
VoiceXmlInterpreter interpreter,
org.jvoicexml.xml.vxml.VoiceXmlDocument document)
Adds all event handlers defined in the given document.
|
JVoiceXMLEvent |
getEvent()
Retrieves the event.
|
void |
processEvent(CatchContainer item)
Processes the last received event.
|
boolean |
removeStrategies(java.util.Collection<EventStrategy> strategies)
Removes the given strategies.
|
JVoiceXMLEvent |
waitEvent()
Waits until an event was generated in the implementation platform.
|
onEventvoid collect(VoiceXmlInterpreterContext context, VoiceXmlInterpreter interpreter, org.jvoicexml.xml.vxml.VoiceXmlDocument document)
context - the current VoiceXmlInterpreterContextinterpreter - the current VoiceXmlInterpreterdocument - the document to inspect.void collect(VoiceXmlInterpreterContext context, VoiceXmlInterpreter interpreter, Dialog dialog)
context - the current VoiceXmlInterpreterContextinterpreter - the current VoiceXmlInterpreterdialog - the dialog to inspect.java.util.Collection<EventStrategy> collect(VoiceXmlInterpreterContext context, VoiceXmlInterpreter interpreter, FormInterpretationAlgorithm fia, CatchContainer item)
context - the current VoiceXmlInterpreterContextinterpreter - the current VoiceXmlInterpreterfia - the current FIA.item - the form item to inspect.void clean(FormItem item)
item - the form itemJVoiceXMLEvent waitEvent()
void processEvent(CatchContainer item) throws JVoiceXMLEvent
item - The current form item.JVoiceXMLEvent - Error or event processing the event or there was no handler
to process the current eventvoid clearEvent()
boolean addStrategy(EventStrategy strategy)
strategy - the strategy to add.true if the strategy was added.boolean removeStrategies(java.util.Collection<EventStrategy> strategies)
strategies - strategies to removetrue if at least one strategy was removedJVoiceXMLEvent getEvent()