org.jvoicexml.interpreter.tagstrategy
Class AbstractTagStrategy

java.lang.Object
  extended by org.jvoicexml.interpreter.tagstrategy.AbstractTagStrategy
All Implemented Interfaces:
Cloneable, TagStrategy
Direct Known Subclasses:
AssignStrategy, AudioStrategy, ClearStrategy, DisconnectStrategy, ExitStrategy, GotoStrategy, IfStrategy, LogStrategy, PromptStrategy, RepromptStrategy, ReturnStrategy, ScriptStrategy, SubmitStrategy, TextStrategy, ThrowStrategy, ValueStrategy, VarStrategy

abstract class AbstractTagStrategy
extends Object
implements Cloneable, TagStrategy

Skeleton for a TagStrategy.

Since:
0.3.1

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

Version:
$Revision: 1.9 $
Author:
Dirk Schnelle

Field Summary
private  Map<String,Object> attributes
          Map with evaluated attributes.
private static Logger LOGGER
          Logger for this class.
 
Constructor Summary
AbstractTagStrategy()
          Constructs a new object.
 
Method Summary
 Object clone()
          
 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.
protected  Object getAttribute(String name)
          Retrieves the value of the given attribute.
 void getAttributes(VoiceXmlInterpreterContext context, 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.
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()
          Validate the attributes of the current node.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.jvoicexml.interpreter.TagStrategy
execute, getEvalAttributes
 

Field Detail

LOGGER

private static final Logger LOGGER
Logger for this class.


attributes

private Map<String,Object> attributes
Map with evaluated attributes.

Constructor Detail

AbstractTagStrategy

public AbstractTagStrategy()
Constructs a new object.

Method Detail

newInstance

public TagStrategy newInstance()
Factory method to get a new instance of this strategy.

Specified by:
newInstance in interface TagStrategy
Returns:
Strategy that can be used in the FIA.
See Also:
FormInterpretationAlgorithm

getAttributes

public void getAttributes(VoiceXmlInterpreterContext context,
                          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.

Specified by:
getAttributes in interface TagStrategy
Parameters:
context - The current VoiceXML interpreter context.
node - The node to process.

evalAttributes

public void evalAttributes(VoiceXmlInterpreterContext context)
                    throws SemanticError
Evaluates all attributes which have to be evaluated by the scripting environment.

Specified by:
evalAttributes in interface TagStrategy
Parameters:
context - The current VoiceXML interpreter context.
Throws:
SemanticError - Error avaluating a variable.

validateAttributes

public void validateAttributes()
                        throws ErrorEvent
Validate the attributes of the current node. Check, if all needed attributes are provided.

Specified by:
validateAttributes in interface TagStrategy
Throws:
ErrorEvent - Validation failed.

clone

public Object clone()

Overrides:
clone in class Object

getAttribute

protected Object getAttribute(String name)
Retrieves the value of the given attribute.

Parameters:
name - Name of the attribute.
Returns:
Value of the attribute, null if the attribute has no associated value.

isAttributeDefined

protected boolean isAttributeDefined(String name)
Checks if the given attribute is defined, this means, neither null nor Context.getUndefinedValue().

Parameters:
name - Name of the attribute.
Returns:
true if the attribute is defined.

dumpNode

public void dumpNode(VoiceXmlNode node)
Debugging facility to display the contents of all attributes in the node.

Specified by:
dumpNode in interface TagStrategy
Parameters:
node - The current node.


Copyright © 2005 JVoiceXML group.