public final class BlockFormItem
extends java.lang.Object
| Constructor and Description |
|---|
BlockFormItem()
Constructs a new object as a template.
|
BlockFormItem(VoiceXmlInterpreterContext context,
org.jvoicexml.xml.VoiceXmlNode voiceNode)
Create a new block form 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. |
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.
|
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.
|
int |
setFormItemVariable(java.lang.Object value)
Sets the value of the form item variable.
|
void |
setVisited()
Mark this form item visited by setting the form item variable to
true. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitevaluateCondition, evaluateExpression, getFormItemVariable, getName, getNode, getNodeTagName, isSelectable, setFormItemVariablepublic BlockFormItem()
public BlockFormItem(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 Blockpublic 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 setVisited()
true.public void accept(FormItemVisitor visitor) throws JVoiceXMLEvent
visitor - The visitor to use.JVoiceXMLEvent - Error or event visiting the form item.public java.util.Collection<org.jvoicexml.xml.vxml.AbstractCatchElement> getCatchElements()
null, since a <block> must not
contain nested catches.public boolean isModal()
true if the form item is modal.public void init(DataModel model) throws SemanticError, BadFetchError
model - 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.VoiceXmlNode> getLocalExecutableTags()
getLocalExecutableTags in interface FormItemLocalExecutableTagContainer