org.jvoicexml.interpreter.formitem
Class FieldFormItem

java.lang.Object
  extended by org.jvoicexml.interpreter.formitem.AbstractFormItem
      extended by org.jvoicexml.interpreter.formitem.InputItem
          extended by org.jvoicexml.interpreter.formitem.FieldFormItem
All Implemented Interfaces:
DialogConstruct, FormItem, PromptCountable, FormItemVisitable

public final class FieldFormItem
extends InputItem

An input item whose value is obtained via ASR or DTMF grammars.

Version:
$Revision: 1.23 $

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

Author:
Dirk Schnelle

Field Summary
private  FieldShadowVarContainer shadowVarContainer
          The shadow var container for this filed.
 
Constructor Summary
FieldFormItem(VoiceXmlInterpreterContext context, VoiceXmlNode voiceNode)
          Create a new field input item.
 
Method Summary
 EventHandler accept(FormItemVisitor visitor)
          Execute the specific method of the visitor.
private  Field getField()
          Get the field belonging to this FieldFormItem.
 Collection<Filled> getFilledElements()
          Get all nested <filled> elements.
 Collection<Grammar> getGrammars()
          Get all nested definitions of a <grammar>.
 Prompt getPrompt()
          Get the prompt belonging to this input field.
 Object getShadowVariableContainer()
          Retrieves the implementation of the shadow var container for this input item.
 void setFormItemVariable(Object value)
          Sets the form item variable. Sets also the shadow variables.
 
Methods inherited from class org.jvoicexml.interpreter.formitem.InputItem
getEventCount, getPromptCount, getShadowVarContainerName, incrementEventCounter, incrementPromptCount, resetEventCounter, resetPromptCount
 
Methods inherited from class org.jvoicexml.interpreter.formitem.AbstractFormItem
getCatchElements, getContext, getExpr, getFormItemVariable, getName, getNode, isSelectable
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.jvoicexml.interpreter.formitem.PromptCountable
getName, getNode
 

Field Detail

shadowVarContainer

private final FieldShadowVarContainer shadowVarContainer
The shadow var container for this filed.

Constructor Detail

FieldFormItem

public FieldFormItem(VoiceXmlInterpreterContext context,
                     VoiceXmlNode voiceNode)
Create a new field input item.

Parameters:
context - The current VoiceXmlInterpreterContext.
voiceNode - The corresponding xml node in the VoiceXML document.
Method Detail

accept

public EventHandler accept(FormItemVisitor visitor)
                    throws JVoiceXMLEvent
Execute the specific method of the visitor.

Parameters:
visitor - The visitor to use.
Returns:
The event handler to use for the processing.
Throws:
JVoiceXMLEvent - Error or event visiting the form item.

setFormItemVariable

public void setFormItemVariable(Object value)
Sets the form item variable. Sets also the shadow variables.

Specified by:
setFormItemVariable in interface FormItem
Overrides:
setFormItemVariable in class AbstractFormItem
Parameters:
value - New value for the form item variable.

getField

private Field getField()
Get the field belonging to this FieldFormItem.

Returns:
The related field or null if there is no field.

getGrammars

public Collection<Grammar> getGrammars()
Get all nested definitions of a <grammar>.

Returns:
Collection about all nested <grammar> tags.

getFilledElements

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

Returns:
Collection about all nested <filled> tags.

getPrompt

public Prompt getPrompt()
Get the prompt belonging to this input field.

Returns:
Prompt to play, null if there is none.

getShadowVariableContainer

public Object getShadowVariableContainer()
Retrieves the implementation of the shadow var container for this input item.

Specified by:
getShadowVariableContainer in class InputItem
Returns:
Class of the shadow var container, null if there is no shadow var container.


Copyright © 2005 JVoiceXML group.