public final class GrammarIdentifierCentral
extends java.lang.Object
GrammarIdentifierCentral takes control over the
process of identifying a grammar. It provides some convenience
methods as an entry point for the identification.| Constructor and Description |
|---|
GrammarIdentifierCentral()
Constructs a new object.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addIdentifier(GrammarIdentifier id)
Adds the given grammar identifier.
|
protected java.util.List<GrammarIdentifier> |
getAvailableIdentifier(org.jvoicexml.xml.srgs.GrammarType type)
Returns a List of identifiers, that have been registered and
are supporting the given type.
|
org.jvoicexml.xml.srgs.GrammarType |
identifyGrammar(GrammarDocument grammar,
org.jvoicexml.xml.srgs.GrammarType expectedType)
Identifies the given grammar.
|
void |
setIdentifier(java.util.List<GrammarIdentifier> grammarIdenifier)
Adds the given list of idententifiers.
|
boolean |
typeSupported(org.jvoicexml.xml.srgs.GrammarType type)
Checks whether the given type is supported by one of the
registered identifiers or not.
|
public GrammarIdentifierCentral()
public org.jvoicexml.xml.srgs.GrammarType identifyGrammar(GrammarDocument grammar, org.jvoicexml.xml.srgs.GrammarType expectedType) throws UnsupportedFormatError
grammar - The given grammar which will be identified.expectedType - the expected grammar typeUnsupportedFormatError - If no identifier is able to identify this grammar.protected java.util.List<GrammarIdentifier> getAvailableIdentifier(org.jvoicexml.xml.srgs.GrammarType type)
type - Required type.public boolean typeSupported(org.jvoicexml.xml.srgs.GrammarType type)
type - String representing the typepublic void setIdentifier(java.util.List<GrammarIdentifier> grammarIdenifier)
grammarIdenifier - List with identifiers to add.public void addIdentifier(GrammarIdentifier id)
id - The GrammarIdentifier to add.