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: 2129 $
Author:
Dirk Schnelle
See Also:
FormItemVisitable, FormInterpretationAlgorithm, FormItem

Method Summary
 void 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.
 void visitFieldFormItem(InputItem item)
          If a <field> is visited, the FIA selects and queues up any prompts based on the item's prompt counter and prompt conditions.
 void visitInitialFormItem(InitialFormItem initial)
          This element controls the initial interaction in a mixed initiative form.
 void visitObjectFormItem(ObjectFormItem object)
          This input item invokes a platform-specific object with various parameters.
 void visitRecordFormItem(RecordFormItem record)
          An input item whose value is an audio clip recorded by the user.
 void visitSubdialogFormItem(SubdialogFormItem subdialog)
          A <>subdialog> input item is roughly like a function call.
 void visitTransferFormItem(TransferFormItem transfer)
          An input item which transfers the user to another telephone number.
 

Method Detail

visitBlockFormItem

void 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.
Throws:
JVoiceXMLEvent - Error or event executing the block.

visitFieldFormItem

void visitFieldFormItem(InputItem item)
                        throws JVoiceXMLEvent
If a <field> is visited, the FIA selects and queues up any prompts based on the item's prompt 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:
item - the input form item to visit.
Throws:
JVoiceXMLEvent - Error or event executing the field.

visitInitialFormItem

void 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.
Throws:
JVoiceXMLEvent - Error or event executing the initial form item.

visitObjectFormItem

void 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.
Throws:
JVoiceXMLEvent - Error or event executing the object form item.

visitRecordFormItem

void 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.
Throws:
JVoiceXMLEvent - Error or event executing the record form item.

visitSubdialogFormItem

void 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.
Throws:
JVoiceXMLEvent - Error or event executing the subdialog form item.

visitTransferFormItem

void 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.
Throws:
JVoiceXMLEvent - Error or event executing the transfer form item.


Copyright © 2005-2010JVoiceXML group.