org.jvoicexml.interpreter
Interface FormItemVisitor

All Known Implementing Classes:
FormInterpretationAlgorithm

public interface FormItemVisitor

A visitor for form items. Form items are visited in the collect phase of the form interpretation algorithm. Visitable form items have to implement the FormItemVisitable interface.

Version:
$Revision: 154 $

Copyright © 2005 JVoiceXML group - http://jvoicexml.sourceforge.net/

Author:
Dirk Schnelle
See Also:
FormItemVisitable, FormInterpretationAlgorithm, FormItem

Method Summary
 EventHandler visitBlockFormItem(BlockFormItem block)
          A <block> element is visited by setting its form item variable to true, evaluating its content, and then bypassing the process phase.
 EventHandler visitFieldFormItem(FieldFormItem field)
          If a <field> is visited, the FIA selects and queues up any prompts based on the item'sprompt counter and prompt conditions.
 EventHandler visitInitialFormItem(InitialFormItem initial)
          This element controls the initial interaction in a mixed initiative form.
 EventHandler visitObjectFormItem(ObjectFormItem object)
          This input item invokes a platform-specific object with various parameters.
 EventHandler visitRecordFormItem(RecordFormItem record)
          An input item whose value is an audio clip recorded by the user.
 EventHandler visitSubdialogFormItem(SubdialogFormItem subdialog)
          A <>subdialog> input item is roughly like a function call.
 EventHandler visitTransferFormItem(TransferFormItem transfer)
          An input item which transfers the user to another telephone number.
 

Method Detail

visitBlockFormItem

EventHandler visitBlockFormItem(BlockFormItem block)
                                throws JVoiceXMLEvent
A <block> element is visited by setting its form item variable to true, evaluating its content, and then bypassing the process phase. No input is collected, and the next iteration of the FIA's main loop is entered.

Parameters:
block - The block form item to visit.
Returns:
Event handler for the process phase.
Throws:
JVoiceXMLEvent - Error or event executing the block.

visitFieldFormItem

EventHandler visitFieldFormItem(FieldFormItem field)
                                throws JVoiceXMLEvent
If a <field> is visited, the FIA selects and queues up any prompts based on the item'sprompt counter and prompt conditions. Then it activates and listens for the field level grammar(s) and any higher-level grammars, and waits for the item to be filled or for some events to be generated.

Parameters:
field - The field form item to visit.
Returns:
Event handler for the process phase.
Throws:
JVoiceXMLEvent - Error or event executing the field.

visitInitialFormItem

EventHandler visitInitialFormItem(InitialFormItem initial)
                                  throws JVoiceXMLEvent
This element controls the initial interaction in a mixed initiative form. Its prompts should be written to encourage the user to say something matching a form level grammar. When at least one input item variable is filled as a result of recognition during an <initial> element, the form item variable of <initial> becomes true, thus removing it as an alternative for the FIA.

Parameters:
initial - The field form item to visit.
Returns:
Event handler for the process phase.
Throws:
JVoiceXMLEvent - Error or event executing the initial form item.

visitObjectFormItem

EventHandler visitObjectFormItem(ObjectFormItem object)
                                 throws JVoiceXMLEvent
This input item invokes a platform-specific object with various parameters. The result of the platform object is an ECMAScript Object. One platform object could be a builtin dialog that gathers credit card information. Another could gather a text message using some proprietary DTMF text entry method. There is no requirement for implementations to provide platform-specific objects, although implementations must handle the <object> element by throwing error.unsupported.objectname if the particular platform-specific object is not supported (note that objectname in error.unsupported.objectname is a fixed string, so not substituted with the name of the unsupported object; more specific error information may be provided in the event _message special variable as described in Section 5.2.2).

Parameters:
object - The object form item to visit.
Returns:
Event handler for the process phase.
Throws:
JVoiceXMLEvent - Error or event executing the object form item.

visitRecordFormItem

EventHandler visitRecordFormItem(RecordFormItem record)
                                 throws JVoiceXMLEvent
An input item whose value is an audio clip recorded by the user. A <record> element could collect a voice mail message, for instance.

Parameters:
record - The record form item to visit.
Returns:
Event handler for the process phase.
Throws:
JVoiceXMLEvent - Error or event executing the record form item.

visitSubdialogFormItem

EventHandler visitSubdialogFormItem(SubdialogFormItem subdialog)
                                    throws JVoiceXMLEvent
A <>subdialog> input item is roughly like a function call. It invokes another dialog on the current page, or invokes another VoiceXML document. It returns an ECMAScript Object as its result.

Parameters:
subdialog - The subdialog form item to visit.
Returns:
Event handler for the process phase.
Throws:
JVoiceXMLEvent - Error or event executing the subdialog form item.

visitTransferFormItem

EventHandler visitTransferFormItem(TransferFormItem transfer)
                                   throws JVoiceXMLEvent
An input item which transfers the user to another telephone number. If the transfer returns control, the field variable will be set to the result status.

Parameters:
transfer - The transfer form item to visit.
Returns:
Event handler for the process phase.
Throws:
JVoiceXMLEvent - Error or event executing the transfer form item.


Copyright © 2005-2007 JVoiceXML group.