|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jvoicexml.interpreter.formitem.ObjectFormItem
public final class ObjectFormItem
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).
UnsupportedObjectnameError| Constructor Summary | |
|---|---|
ObjectFormItem(VoiceXmlInterpreterContext context,
VoiceXmlNode voiceNode)
Creates a new object input item. |
|
| Method Summary | |
|---|---|
void |
accept(FormItemVisitor visitor)
Execute the specific method of the visitor. |
protected Object |
createShadowVarContainer()
Creates a corresponding shadow var container. |
Collection<AbstractCatchElement> |
getCatchElements()
Retrieves all nested catch elements. |
boolean |
getCondition()
An expression to evaluate in conjunction with the test of the form item variable. |
protected VoiceXmlInterpreterContext |
getContext()
Retrieves the current VoiceXmlInterpreterContext. |
int |
getEventCount(String type)
Retrieve the counter for the given event type. |
Object |
getExpression()
Selector for the expr attribute. |
Collection<Filled> |
getFilledElements()
Gets all nested <filled> elements. |
Object |
getFormItemVariable()
Retrieves the form item variable. |
Collection<VoiceXmlNode> |
getLocalExecutableTags()
Retrieves the nested tags that have to be executed locally. |
String |
getName()
Retrieves the name of this FormItem.. |
VoiceXmlNode |
getNode()
Retrieves the encapsulated VoiceXmlNode. |
String |
getNodeTagName()
Retrieves the tag name of the encapsulated node. |
int |
getPromptCount()
Retrieves the value of the prompt counter. |
protected String |
getShadowVarContainerName()
Retrieves the name of the corresponding shadow var container name. |
Class<? extends Object> |
getShadowVariableContainer()
Retrieves the implementation of the shadow var container for this input item. |
void |
incrementEventCounter(JVoiceXMLEvent event)
Increment counters for all events that have the same name as the given event or have a name that is a prefix of the given event. |
void |
incrementPromptCount()
Increments the prompt counter. |
void |
init(ScriptingEngine scripting)
Initializes this form item. |
boolean |
isModal()
Checks if this form item is modal. |
boolean |
isSelectable()
Guard conditions, which governs whether or not this form item can be selected by the form interpretation algorithm. |
void |
resetEventCounter()
Reset the event counter. |
void |
resetPromptCount()
Resets the prompt counter. |
protected void |
resetShadowVarContainer()
Reset the shadow var container. |
void |
setFormItemVariable(Object value)
Sets the value of the form item variable. |
| 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.CatchContainer |
|---|
getCatchElements |
| Methods inherited from interface org.jvoicexml.interpreter.FormItem |
|---|
getCondition, getExpression, getFormItemVariable, getName, getNode, getNodeTagName, isSelectable, setFormItemVariable |
| Methods inherited from interface org.jvoicexml.interpreter.PromptCountable |
|---|
getName, getNode |
| Constructor Detail |
|---|
public ObjectFormItem(VoiceXmlInterpreterContext context,
VoiceXmlNode voiceNode)
context - The current VoiceXmlInterpreterContext.voiceNode - The corresponding xml node in the VoiceXML document.| Method Detail |
|---|
public void accept(FormItemVisitor visitor)
throws JVoiceXMLEvent
visitor - The visitor to use.
JVoiceXMLEvent - Error or event visiting the form item.
protected void resetShadowVarContainer()
throws SemanticError
SemanticError - error resetting the shadow var container.public Class<? extends Object> getShadowVariableContainer()
null since there is no shadow var container.public boolean isModal()
true if the form item is modal.public final void incrementEventCounter(JVoiceXMLEvent event)
incrementEventCounter in interface EventCountableevent - Event to increment.public final void resetEventCounter()
resetEventCounter in interface EventCountablepublic final int getPromptCount()
getPromptCount in interface PromptCountablepublic final void incrementPromptCount()
incrementPromptCount in interface PromptCountablepublic final void resetPromptCount()
resetPromptCount in interface PromptCountablepublic final int getEventCount(String type)
getEventCount in interface EventCountabletype - Event type.
protected final String getShadowVarContainerName()
protected final Object createShadowVarContainer()
throws SemanticError
SemanticError - Error creating a host object.public final Collection<Filled> getFilledElements()
<filled> elements.
getFilledElements in interface InputItem<filled> tags.
public void init(ScriptingEngine scripting)
throws SemanticError,
BadFetchError
init in interface FormItemscripting - current scripting engine
SemanticError - error initializing this form item
BadFetchError - error initializing this form itempublic final Object getFormItemVariable()
Each form has an associated form item variable. which by default is set
to ECMA_SCRIPT_UNDEFINED when the form is entered. This
form item variable will contain the result of interpreting the form item.
An input item's form variable can be given a name using the name
attribute or left nameless in which case an internal name is generated.
getFormItemVariable in interface FormItemContext.getUndefinedValue()
public void setFormItemVariable(Object value)
throws SemanticError
setFormItemVariable in interface FormItemvalue - New value for the form item variable.
SemanticError - error setting the valuepublic final String getName()
FormItem..
getName in interface FormItem
public final Object getExpression()
throws SemanticError
expr attribute.
getExpression in interface FormItemexpr attribute.
SemanticError - error evaluating the expr attribute.
public boolean getCondition()
throws SemanticError
true, or in the case
of <initial>, a test to see if any input item
variable has been filled in.
getCondition in interface FormItemtrue if the cond attribute of the
form item evaluates to true.
SemanticError - error evaluating the cond attribute.
public boolean isSelectable()
throws SemanticError
This default guard condition just tests to see if the form item variable has a value. If it does, this form item will not be visited.
isSelectable in interface FormItemtrue if the form item's variable has no value.
SemanticError - error evaluating the cond condition.FormItem.getFormItemVariable(),
Context.getUndefinedValue()public final VoiceXmlNode getNode()
VoiceXmlNode.
getNode in interface FormItemVoiceXmlNode.public final String getNodeTagName()
getNodeTagName in interface FormItemprotected final VoiceXmlInterpreterContext getContext()
VoiceXmlInterpreterContext.
VoiceXmlInterpreterContext.public Collection<AbstractCatchElement> getCatchElements()
public Collection<VoiceXmlNode> getLocalExecutableTags()
getLocalExecutableTags in interface FormItemLocalExecutableTagContainer
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||