org.jvoicexml.interpreter.event
Class AbstractEventStrategy

java.lang.Object
  extended by org.jvoicexml.interpreter.event.AbstractEventStrategy
All Implemented Interfaces:
XmlWritable
Direct Known Subclasses:
CatchEventStrategy, ChildNodeEventStrategy, RecognitionEventStrategy

public abstract class AbstractEventStrategy
extends Object
implements XmlWritable

Strategy to process an event coming from the implementation platform.

Version:
$Revision: 1.3 $
Author:
Dirk Schnelle
See Also:

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


Field Summary
private  VoiceXmlInterpreterContext context
          The VoiceXML interpreter context.
private  int count
          The count.
private  String event
          The event type.
private  FormInterpretationAlgorithm fia
          The current FIA.
private  VoiceXmlInterpreter interpreter
          The VoiceXML interpreter.
private  AbstractFormItem item
          The current form item.
private  VoiceXmlNode node
          The child node with which to continue.
 
Constructor Summary
protected AbstractEventStrategy(VoiceXmlInterpreterContext ctx, VoiceXmlInterpreter ip, FormInterpretationAlgorithm algorithm, AbstractFormItem formItem, VoiceXmlNode n, String type)
          Construct a new object.
 
Method Summary
 int getCount()
          Get the count.
 String getEventType()
          Retrieves the event type.
protected  FormInterpretationAlgorithm getFormInterpretationAlgorithm()
          Retrieve the FIA.
protected  AbstractFormItem getFormItem()
          Retrieves the current form item.
protected  VoiceXmlInterpreter getVoiceXmlInterpreter()
          Retrieve the interpreter property.
protected  VoiceXmlInterpreterContext getVoiceXmlInterpreterContext()
          Retrieve the context property.
protected  VoiceXmlNode getVoiceXmlNode()
          Retrieves the child node with which to continue.
(package private) abstract  void process(JVoiceXMLEvent ev)
          Process the event.
 String toString()
          Returns a string representation of the object.
 void writeChildrenXml(XmlWriter writer)
          Used to write any children of a node.
 void writeXml(XmlWriter writer)
          This is the primary method used to write an object and its children as XML text.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

context

private final VoiceXmlInterpreterContext context
The VoiceXML interpreter context.


interpreter

private final VoiceXmlInterpreter interpreter
The VoiceXML interpreter.


fia

private final FormInterpretationAlgorithm fia
The current FIA.


item

private final AbstractFormItem item
The current form item.


node

private final VoiceXmlNode node
The child node with which to continue.


event

private final String event
The event type.


count

private final int count
The count.

Constructor Detail

AbstractEventStrategy

protected AbstractEventStrategy(VoiceXmlInterpreterContext ctx,
                                VoiceXmlInterpreter ip,
                                FormInterpretationAlgorithm algorithm,
                                AbstractFormItem formItem,
                                VoiceXmlNode n,
                                String type)
Construct a new object.

Parameters:
ctx - The VoiceXML interpreter context.
ip - The VoiceXML interpreter.
algorithm - The FIA.
formItem - The current form item.
n - The child node with which to continue.
type - The event type.
Method Detail

getVoiceXmlInterpreterContext

protected final VoiceXmlInterpreterContext getVoiceXmlInterpreterContext()
Retrieve the context property.

Returns:
The VoiceXML interpreter context.

getVoiceXmlInterpreter

protected final VoiceXmlInterpreter getVoiceXmlInterpreter()
Retrieve the interpreter property.

Returns:
The VoiceXML interpreter.

getFormInterpretationAlgorithm

protected final FormInterpretationAlgorithm getFormInterpretationAlgorithm()
Retrieve the FIA.

Returns:
The current FIA.

getFormItem

protected final AbstractFormItem getFormItem()
Retrieves the current form item.

Returns:
The current form item.

getVoiceXmlNode

protected final VoiceXmlNode getVoiceXmlNode()
Retrieves the child node with which to continue.

Returns:
The child node with which to continue.

getEventType

public final String getEventType()
Retrieves the event type.

Returns:
The event type.

process

abstract void process(JVoiceXMLEvent ev)
               throws JVoiceXMLEvent
Process the event.

Parameters:
ev - The caught event.
Throws:
JVoiceXMLEvent - Error or event processing the current tag.

writeXml

public final void writeXml(XmlWriter writer)
                    throws IOException
This is the primary method used to write an object and its children as XML text.

Specified by:
writeXml in interface XmlWritable
Parameters:
writer - XMLWriter used when writing XML text.
Throws:
IOException - Error in writing.

writeChildrenXml

public void writeChildrenXml(XmlWriter writer)
                      throws IOException
Used to write any children of a node.

Specified by:
writeChildrenXml in interface XmlWritable
Parameters:
writer - XMLWriter used when writing XML text.
Throws:
IOException - Error in writing.

toString

public final String toString()
Returns a string representation of the object.

Overrides:
toString in class Object
Returns:
a string representation of the object.

getCount

public final int getCount()
Get the count.

Returns:
The count.


Copyright © 2005 JVoiceXML group.