org.jvoicexml.interpreter.dialog
Class ConvertedChoiceOption

java.lang.Object
  extended by org.jvoicexml.interpreter.dialog.ConvertedChoiceOption
All Implemented Interfaces:
Cloneable

public final class ConvertedChoiceOption
extends Object
implements Cloneable

A converted choice option. The core attributes are the accepted inputs and the grammar. Accepted inputs are used to create the <if> conditions. A grammar node can be used to bypass the generation of a SRGS XML grammar from the accepted inputs. If at least one ConvertedChoiceOption contains a grammar node, no SRGS grammar will be generated. The created grammar is appended as a child node to the generated anonymous field by calling setGrammar(Grammar).

Since:
0.7.5
Version:
$Revision: 2612 $
Author:
Dirk Schnelle-Walka

Constructor Summary
ConvertedChoiceOption(Field fld)
          Constructs a new object.
 
Method Summary
 void addAcceptedInput(String input)
          Adds the given input to the list of accepted inputs.
protected  ConvertedChoiceOption clone()
          
 Grammar createGrammarNode()
          Creates an empty grammar node within the field.
 AcceptType getAccept()
          Retrieves the accept type.
 Collection<String> getAcceptedInputs()
          Retrieves the accepted inputs.
 String getDtmf()
          Retrieves the DTMF sequence of a choice node.
 JVoiceXMLEvent getEvent()
          Retrieves the event to be thrwon instead of a next.
 Grammar getGrammar()
          Retrieves the grammar object.
 ModeType getMode()
          Sets the mode type.
 URI getNext()
          Retrieves the URI of next dialog or document.
 String getText()
          Retrieves the text within the choice node.
 void setAccept(AcceptType acceptType)
          Sets the accept type.
 void setAcceptedInputs(Collection<String> inputs)
          Set the accepted inputs of the grammar.
 void setDtmf(String value)
          Sets the DTMF sequence that is set in the choice node.
 void setEvent(JVoiceXMLEvent e)
          Sets the event to be thrown instead of a next.
 void setGrammar(Grammar gram)
          Sets the grammar object.
 void setMode(ModeType modeType)
          Retrieves the mode type.
 void setNext(URI uri)
          Sets the URI of next dialog or document.
 void setText(String txt)
          Sets the text that is contained in the choice node.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConvertedChoiceOption

public ConvertedChoiceOption(Field fld)
Constructs a new object.

Parameters:
fld - the created field
Method Detail

getMode

public ModeType getMode()
Sets the mode type.

Returns:
the mode

setMode

public void setMode(ModeType modeType)
Retrieves the mode type.

Parameters:
modeType - the mode to set

getAcceptedInputs

public Collection<String> getAcceptedInputs()
Retrieves the accepted inputs.

Returns:
the acceptedInputs

setAcceptedInputs

public void setAcceptedInputs(Collection<String> inputs)
Set the accepted inputs of the grammar.

Parameters:
inputs - the acceptedInputs to set

addAcceptedInput

public void addAcceptedInput(String input)
Adds the given input to the list of accepted inputs.

Parameters:
input - the input to accept

getAccept

public AcceptType getAccept()
Retrieves the accept type.

Returns:
the accept

setAccept

public void setAccept(AcceptType acceptType)
Sets the accept type.

Parameters:
acceptType - the accept to set

getGrammar

public Grammar getGrammar()
Retrieves the grammar object.

Returns:
the grammar

setGrammar

public void setGrammar(Grammar gram)
Sets the grammar object.

Parameters:
gram - the grammar to set

createGrammarNode

public Grammar createGrammarNode()
Creates an empty grammar node within the field.

Returns:
the created grammar node
Since:
0.7.5

getNext

public URI getNext()
Retrieves the URI of next dialog or document.

Returns:
the next

setNext

public void setNext(URI uri)
Sets the URI of next dialog or document.

Parameters:
uri - the next to set

getEvent

public JVoiceXMLEvent getEvent()
Retrieves the event to be thrwon instead of a next.

Returns:
the event

setEvent

public void setEvent(JVoiceXMLEvent e)
Sets the event to be thrown instead of a next.

Parameters:
e - the event to set

getText

public String getText()
Retrieves the text within the choice node.

Returns:
the text

setText

public void setText(String txt)
Sets the text that is contained in the choice node.

Parameters:
txt - the text to set

getDtmf

public String getDtmf()
Retrieves the DTMF sequence of a choice node.

Returns:
the DTMF sequence

setDtmf

public void setDtmf(String value)
Sets the DTMF sequence that is set in the choice node.

Parameters:
value - the DTMF sequence to set

clone

protected ConvertedChoiceOption clone()

Overrides:
clone in class Object


Copyright © 2005-2010JVoiceXML group.