public final class ObjectFormItem
extends java.lang.Object
<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 and Description |
|---|
ObjectFormItem()
Constructs a new object as a template.
|
ObjectFormItem(VoiceXmlInterpreterContext context,
org.jvoicexml.xml.VoiceXmlNode voiceNode)
Creates a new object input item.
|
| Modifier and Type | Method and Description |
|---|---|
void |
accept(FormItemVisitor visitor)
Execute the specific method of the visitor.
|
boolean |
evaluateCondition()
An expression to evaluate in conjunction with the test of the form item
variable.
|
java.lang.Object |
evaluateExpression(DataModel model)
Retrieves the evaluated
expr attribute. |
java.util.Collection<org.jvoicexml.xml.vxml.AbstractCatchElement> |
getCatchElements()
Retrieves all nested catch elements.
|
protected VoiceXmlInterpreterContext |
getContext()
Retrieves the current
VoiceXmlInterpreterContext. |
int |
getEventCount(java.lang.String type)
Retrieve the counter for the given event type.
|
java.util.Collection<org.jvoicexml.xml.vxml.Filled> |
getFilledElements()
Gets all nested
<filled> elements. |
java.lang.Object |
getFormItemVariable()
Retrieves the form item variable.
|
java.util.Collection<org.jvoicexml.xml.VoiceXmlNode> |
getLocalExecutableTags()
Retrieves the nested tags that have to be executed locally.
|
java.lang.String |
getName()
Retrieves the name of this
FormItem.. |
org.jvoicexml.xml.VoiceXmlNode |
getNode()
Retrieves the encapsulated
VoiceXmlNode. |
java.lang.String |
getNodeTagName()
Retrieves the tag name of the encapsulated node.
|
int |
getPromptCount()
Retrieves the value of the prompt counter.
|
protected java.lang.String |
getShadowVarContainerName()
Retrieves the name of the corresponding shadow var container name.
|
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(DataModel model)
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.
|
org.jvoicexml.interpreter.formitem.AbstractFormItem |
newInstance(VoiceXmlInterpreterContext ctx,
org.jvoicexml.xml.VoiceXmlNode voiceNode)
Factory method to create a new instance from a template.
|
void |
resetEventCounter()
Reset the event counter.
|
void |
resetPromptCount()
Resets the prompt counter.
|
int |
setFormItemVariable(java.lang.Object value)
Sets the value of the form item variable.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetCatchElementsevaluateCondition, evaluateExpression, getFormItemVariable, getName, getNode, getNodeTagName, isSelectable, setFormItemVariablegetName, getNodepublic ObjectFormItem()
public ObjectFormItem(VoiceXmlInterpreterContext context, org.jvoicexml.xml.VoiceXmlNode voiceNode) throws java.lang.IllegalArgumentException
context - The current VoiceXmlInterpreterContext.voiceNode - The corresponding xml node in the VoiceXML document.java.lang.IllegalArgumentException - if the given node is not a Objectpublic org.jvoicexml.interpreter.formitem.AbstractFormItem newInstance(VoiceXmlInterpreterContext ctx, org.jvoicexml.xml.VoiceXmlNode voiceNode)
ctx - The current VoiceXmlInterpreterContext.voiceNode - The corresponding XML node in the VoiceXML document.public void accept(FormItemVisitor visitor) throws JVoiceXMLEvent
visitor - The visitor to use.JVoiceXMLEvent - Error or event visiting the form item.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(java.lang.String type)
getEventCount in interface EventCountabletype - Event type.protected final java.lang.String getShadowVarContainerName()
public final java.util.Collection<org.jvoicexml.xml.vxml.Filled> getFilledElements()
<filled> elements.getFilledElements in interface InputItem<filled> tags.public void init(DataModel model) throws SemanticError, BadFetchError
init in interface FormItemmodel - the employed data modelSemanticError - error initializing this form itemBadFetchError - error initializing this form itempublic final java.lang.Object getFormItemVariable()
Each form has an associated form item variable. which by default is set
to null 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 FormItemDataModelpublic int setFormItemVariable(java.lang.Object value)
throws SemanticError
setFormItemVariable in interface FormItemvalue - new value for the form item variable.0 if setting the form item variable was successfulSemanticError - error setting the valuepublic final java.lang.String getName()
FormItem..public final java.lang.Object evaluateExpression(DataModel model) throws SemanticError
expr attribute.evaluateExpression in interface FormItemmodel - the data model to use for evaluationexpr attribute.SemanticError - error evaluating the expr attribute.public boolean evaluateCondition()
throws SemanticError
true, or in the case
of <initial>, a test to see if any input item variable
has been filled in.evaluateCondition 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()public final org.jvoicexml.xml.VoiceXmlNode getNode()
VoiceXmlNode.public final java.lang.String getNodeTagName()
getNodeTagName in interface FormItemprotected final VoiceXmlInterpreterContext getContext()
VoiceXmlInterpreterContext.VoiceXmlInterpreterContext.public java.util.Collection<org.jvoicexml.xml.vxml.AbstractCatchElement> getCatchElements()
public java.util.Collection<org.jvoicexml.xml.VoiceXmlNode> getLocalExecutableTags()
getLocalExecutableTags in interface FormItemLocalExecutableTagContainer