org.jvoicexml.interpreter.grammar.transformer
Class SrgsXmlGrammarTransformer

java.lang.Object
  extended by org.jvoicexml.interpreter.grammar.transformer.SrgsXmlGrammarTransformer
All Implemented Interfaces:
GrammarTransformer

public final class SrgsXmlGrammarTransformer
extends Object
implements GrammarTransformer

This class implements the GrammarTransformer interface. An instance of this class is able to transform a SRGS grammar with XML format into RuleGrammar instance. The mime type of the accepted grammar is application/srgs+xml.

Version:
$Revision: 213 $

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

Author:
Christoph Buente, Dirk Schnelle

Constructor Summary
SrgsXmlGrammarTransformer()
          Standard constructor to instantiate as much GrammarTransformer as you need.
 
Method Summary
 GrammarImplementation<? extends Object> createGrammar(UserInput input, GrammarDocument grammar, GrammarType type)
          Creates a JSGF compatible grammar object, which can be passed to the ASR engine.
 GrammarType getSourceType()
          Returns the supported source media type.
 GrammarType getTargetType()
          Returns the supported result media type.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SrgsXmlGrammarTransformer

public SrgsXmlGrammarTransformer()
Standard constructor to instantiate as much GrammarTransformer as you need.

Method Detail

getSourceType

public GrammarType getSourceType()
Returns the supported source media type.

Specified by:
getSourceType in interface GrammarTransformer
Returns:
the supported source media type.

getTargetType

public GrammarType getTargetType()
Returns the supported result media type.

Specified by:
getTargetType in interface GrammarTransformer
Returns:
the supported result media type.

createGrammar

public GrammarImplementation<? extends Object> createGrammar(UserInput input,
                                                             GrammarDocument grammar,
                                                             GrammarType type)
                                                      throws NoresourceError,
                                                             UnsupportedFormatError,
                                                             BadFetchError
Creates a JSGF compatible grammar object, which can be passed to the ASR engine.

Specified by:
createGrammar in interface GrammarTransformer
Parameters:
input - The current UserInput to create an empty grammar.
grammar - The grammar document to transform.
type - The target type of the grammar.
Returns:
The result of the transformation. A grammar representation which can be passed to an ASR engine.
Throws:
NoresourceError - Error creating a grammar from the input device.
UnsupportedFormatError - If an unsupported grammar has been given.
BadFetchError - If the document could not be fetched successfully.


Copyright © 2005-2007 JVoiceXML group.