org.jvoicexml.xml.srgs
Class GrammarType

java.lang.Object
  extended by org.jvoicexml.xml.srgs.GrammarType

public class GrammarType
extends Object

Defintion of the type of the grammar.

In order to define custom grammar types this class must be derived. In addition it is required to implement a custom GrammarTypeFactory to be able to obtain the added grammar type for the added type. The GrammarTypeFactory is looked up using the service locator mechanism. Therefore, the jar containing the extra grammar type must be in the classpath at startup time.

Since:
0.5.5
Version:
$Revision: 2774 $
Author:
Dirk Schnelle-Walka

Field Summary
static GrammarType GSL
          Nuance GSL grammar format as defined at http://cafe.bevocal.com/docs/grammar/gsl.html#198142.
static GrammarType GSL_BINARY
          Binary Nuance GSL grammar format as defined at http://cafe.bevocal.com/docs/grammar/define.html#195253.
static GrammarType JSGF
          JSGF formatted grammar.
static GrammarType SRGS_ABNF
          SRGS grammar with ABNF format.
static GrammarType SRGS_XML
          SRGS grammar in XML format.
 
Constructor Summary
protected GrammarType(String name, boolean isXml)
          Do not create from outside.
 
Method Summary
 String getType()
          Retrieves the name of this grammar type.
 boolean isXmlFormat()
          Checks if this grammar type is XML formatted.
 String toString()
          
static GrammarType valueOfAttribute(String attribute)
          Converts the given value of the attribute into a GrammarType object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

JSGF

public static final GrammarType JSGF
JSGF formatted grammar.


SRGS_ABNF

public static final GrammarType SRGS_ABNF
SRGS grammar with ABNF format.


SRGS_XML

public static final GrammarType SRGS_XML
SRGS grammar in XML format.


GSL

public static final GrammarType GSL
Nuance GSL grammar format as defined at http://cafe.bevocal.com/docs/grammar/gsl.html#198142.


GSL_BINARY

public static final GrammarType GSL_BINARY
Binary Nuance GSL grammar format as defined at http://cafe.bevocal.com/docs/grammar/define.html#195253.

Constructor Detail

GrammarType

protected GrammarType(String name,
                      boolean isXml)
Do not create from outside.

Parameters:
name - name of the grammar type.
isXml - true if the grammar is XML formatted
Method Detail

getType

public final String getType()
Retrieves the name of this grammar type.

Returns:
Name of this type.

isXmlFormat

public final boolean isXmlFormat()
Checks if this grammar type is XML formatted.

Returns:
true if the grammar is XML formatted.
Since:
0.7.5

toString

public final String toString()

Overrides:
toString in class Object

valueOfAttribute

public static final GrammarType valueOfAttribute(String attribute)
Converts the given value of the attribute into a GrammarType object. If the attribute can not be resolved, an IllegalArgumentException is thrown.

Parameters:
attribute - Value of the attribute as it is specified in a Grammar type.
Returns:
corresponding GrammarType object.
Since:
0.6


Copyright © 2005-2009JVoiceXML group.