org.jvoicexml.interpreter.dialog
Class ExecutableMenuForm

java.lang.Object
  extended by org.jvoicexml.interpreter.dialog.ExecutableMenuForm
All Implemented Interfaces:
Cloneable, Dialog, DialogConstruct

public final class ExecutableMenuForm
extends Object
implements Dialog

Implementation of a Dialog for the <menu> tag.

Since a menu is a shorthand notation for a field, this implementation creates a new field from the menu which is handled by the interpreter.

Since:
0.4
Version:
$Revision: 2612 $
Author:
Dirk Schnelle-Walka
See Also:
Menu

Constructor Summary
ExecutableMenuForm()
          Constructs a new object.
 
Method Summary
 Dialog clone()
          Creates a clone of this dialog.
 Collection<AbstractCatchElement> getCatchElements()
          Gets all nested <catch> elements.
 Collection<XmlNode> getChildNodes()
          Retrieves the child nodes of this executable form.
 Collection<Filled> getFilledElements()
          Gets all nested <filled> elements.
 Collection<FormItem> getFormItems(VoiceXmlInterpreterContext context)
          Retrieves all FormItems, defined in this form.
 String getId()
          Retrieves the identifier of this dialog.
 void setChoiceConverter(ChoiceConverter choiceConverter)
          Sets the choice converter to use.
 void setNode(XmlNode node)
          Associates the dialog with the given node.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExecutableMenuForm

public ExecutableMenuForm()
Constructs a new object.

Method Detail

setNode

public void setNode(XmlNode node)
             throws IllegalArgumentException
Associates the dialog with the given node.

Specified by:
setNode in interface Dialog
Parameters:
node - the node
Throws:
IllegalArgumentException - if the dialog can not be associated with the node

setChoiceConverter

public void setChoiceConverter(ChoiceConverter choiceConverter)
Sets the choice converter to use.

Parameters:
choiceConverter - the choice converter
Since:
0.7.5

getId

public String getId()
Retrieves the identifier of this dialog. It allows the Dialog to be target of a <goto> or a <submit>.

If the related form or menu does not provide an id a randomly chosen id is returned as the id for this dialog.

Specified by:
getId in interface Dialog
Returns:
identifier for this form.

getChildNodes

public Collection<XmlNode> getChildNodes()
Retrieves the child nodes of this executable form.

Specified by:
getChildNodes in interface Dialog
Returns:
child nodes of the created anonymous field, null if the field has not been created.

getFormItems

public Collection<FormItem> getFormItems(VoiceXmlInterpreterContext context)
                                  throws BadFetchError
Retrieves all FormItems, defined in this form. Creates an anonymous field, which does not exist in the document.

Specified by:
getFormItems in interface Dialog
Parameters:
context - The current context.
Returns:
Collection of FormItems.
Throws:
BadFetchError - Error converting choices.

getFilledElements

public Collection<Filled> getFilledElements()
Gets all nested <filled> elements.

Specified by:
getFilledElements in interface Dialog
Returns:
null since the menu is transformed into an anonymous <field> element.

getCatchElements

public Collection<AbstractCatchElement> getCatchElements()
Gets all nested <catch> elements.

Specified by:
getCatchElements in interface Dialog
Returns:
Collection of all nested <catch> tags.

clone

public Dialog clone()
Creates a clone of this dialog.

Specified by:
clone in interface Dialog
Overrides:
clone in class Object
Returns:
clone of this dialog


Copyright © 2005-2010JVoiceXML group.