|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jvoicexml.interpreter.tagstrategy.IfStrategy
public final class IfStrategy
Strategy of the FIA to execute an <if> node.
This class is also responsible to handle the <else>
and <elseif> tags since they can appear only as
children of the <if> tag.
FormInterpretationAlgorithm,
If| Method Summary | |
|---|---|
Object |
clone()
The evaluated attributes are cloned via a shallow copy. |
void |
dumpNode(VoiceXmlNode node)
Debugging facility to display the contents of all attributes in the node. |
void |
evalAttributes(VoiceXmlInterpreterContext context)
Evaluates all attributes which have to be evaluated by the scripting environment. |
void |
execute(VoiceXmlInterpreterContext context,
VoiceXmlInterpreter interpreter,
FormInterpretationAlgorithm fia,
FormItem item,
VoiceXmlNode node)
Executes the strategy with the current parameters. |
void |
executeLocal(VoiceXmlInterpreterContext context,
VoiceXmlInterpreter interpreter,
FormInterpretationAlgorithm fia,
FormItem item,
VoiceXmlNode node)
Executes the strategy with the current parameters local to a form item. |
protected Object |
getAttribute(String name)
Retrieves the value of the given attribute. |
void |
getAttributes(VoiceXmlInterpreterContext context,
FormInterpretationAlgorithm fia,
VoiceXmlNode node)
Retrieves all attributes specified by the given node or by a <property> tag and stores their
values in the working copy of this strategy. |
Collection<String> |
getEvalAttributes()
Retrieves the names of all attributes, which have to be evaluated by the scripting environment. |
protected boolean |
isAttributeDefined(String name)
Checks if the given attribute is defined, this means, neither null nor Context.getUndefinedValue(). |
TagStrategy |
newInstance()
Factory method to get a new instance of this strategy. |
void |
validateAttributes()
Validates the attributes of the current node. |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public Collection<String> getEvalAttributes()
The evaluation is done with a more general algorithm in the
execute(VoiceXmlInterpreterContext, VoiceXmlInterpreter, FormInterpretationAlgorithm, FormItem, VoiceXmlNode)
method.
null
if the related node has not attributes to be evaluated.
public void execute(VoiceXmlInterpreterContext context,
VoiceXmlInterpreter interpreter,
FormInterpretationAlgorithm fia,
FormItem item,
VoiceXmlNode node)
throws JVoiceXMLEvent
context - The VoiceXML interpreter context.interpreter - The current VoiceXML interpreter.fia - The current form interpretation algorithm, maybe null
if there is no current fia.item - The current form item,maybe null if there is no
current form item.node - The current child node.
JVoiceXMLEvent - Error while executing this strategy.public TagStrategy newInstance()
newInstance in interface TagStrategyFormInterpretationAlgorithm
public void getAttributes(VoiceXmlInterpreterContext context,
FormInterpretationAlgorithm fia,
VoiceXmlNode node)
<property> tag and stores their
values in the working copy of this strategy.
Retrieves all attributes of the current tag and store their values
in the attributes map. If there is no value in the prompt, the method
tries to find a value that has been set via a
<property> tag.
Implementations are requested to obtain the values via the
getAttribute(String) method.
getAttributes in interface TagStrategycontext - The current VoiceXML interpreter context.fia - The current form interpretation algorithm, maybe null
if there is no current fia.node - The node to process.
public void evalAttributes(VoiceXmlInterpreterContext context)
throws SemanticError
evalAttributes in interface TagStrategycontext - The current VoiceXML interpreter context.
SemanticError - Error evaluating a variable.
public void validateAttributes()
throws ErrorEvent
validateAttributes in interface TagStrategyErrorEvent - Validation failed.public Object clone()
clone in class Objectprotected Object getAttribute(String name)
name - Name of the attribute.
null if the attribute
has no associated value.protected boolean isAttributeDefined(String name)
null nor Context.getUndefinedValue().
name - Name of the attribute.
true if the attribute is defined.public void dumpNode(VoiceXmlNode node)
dumpNode in interface TagStrategynode - The current node.
public void executeLocal(VoiceXmlInterpreterContext context,
VoiceXmlInterpreter interpreter,
FormInterpretationAlgorithm fia,
FormItem item,
VoiceXmlNode node)
throws JVoiceXMLEvent
executeLocal in interface TagStrategycontext - The VoiceXML interpreter context.interpreter - The current VoiceXML interpreter.fia - The current form interpretation algorithm, maybe null
if there is no current fia.item - The current form item,maybe null if there is no
current form item.node - The current child node.
JVoiceXMLEvent - Error while executing this strategy.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||