public class GrammarType
extends java.lang.Object
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.
| Modifier and Type | Field and Description |
|---|---|
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.
|
| Modifier | Constructor and Description |
|---|---|
protected |
GrammarType(java.lang.String name,
boolean isXml)
Do not create from outside.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object obj) |
java.lang.String |
getType()
Retrieves the name of this grammar type.
|
int |
hashCode() |
boolean |
isXmlFormat()
Checks if this grammar type is XML formatted.
|
java.lang.String |
toString() |
static GrammarType |
valueOfAttribute(java.lang.String attribute)
Converts the given value of the attribute into a
GrammarType object. |
public static final GrammarType JSGF
public static final GrammarType SRGS_ABNF
public static final GrammarType SRGS_XML
public static final GrammarType GSL
public static final GrammarType GSL_BINARY
protected GrammarType(java.lang.String name,
boolean isXml)
name - name of the grammar type.isXml - true if the grammar is XML formattedpublic final java.lang.String getType()
public final boolean isXmlFormat()
true if the grammar is XML formatted.public final java.lang.String toString()
toString in class java.lang.Objectpublic static final GrammarType valueOfAttribute(java.lang.String attribute)
GrammarType object. If the attribute can not be
resolved, an IllegalArgumentException is thrown.attribute - Value of the attribute as it is specified in
a Grammar type.GrammarType object.public int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Object