public abstract class AbstractGrammar extends java.lang.Object implements Grammar
| Modifier and Type | Field and Description |
|---|---|
protected java.lang.String |
name
The grammar name
|
protected java.util.HashMap<Tag,GrammarTransition>[] |
transitions
Table of transitions.
|
| Constructor and Description |
|---|
AbstractGrammar() |
| Modifier and Type | Method and Description |
|---|---|
void |
executeAction(Dsmlv2Container container)
This method, when called, executes an action on the current data stored in
the container.
|
java.lang.String |
getName()
Returns the grammar's name
|
java.lang.Enum<Dsmlv2StatesEnum>[] |
getStatesEnum()
Gets the states of the current grammar
|
GrammarTransition |
getTransition(java.lang.Enum<Dsmlv2StatesEnum> state,
Tag tag)
Gets the transition associated with the state and tag
|
private void |
processTag(Dsmlv2Container container,
int tagType)
Processes the task required in the grammar to the given tag type
|
void |
setName(java.lang.String name)
Sets the grammar's name
|
protected java.util.HashMap<Tag,GrammarTransition>[] transitions
protected java.lang.String name
public java.lang.String getName()
public void setName(java.lang.String name)
public GrammarTransition getTransition(java.lang.Enum<Dsmlv2StatesEnum> state, Tag tag)
state - The current statetag - The current tagpublic java.lang.Enum<Dsmlv2StatesEnum>[] getStatesEnum()
getStatesEnum in interface Grammarpublic void executeAction(Dsmlv2Container container) throws org.xmlpull.v1.XmlPullParserException, java.io.IOException
executeAction in interface Grammarcontainer - the DSML containerorg.xmlpull.v1.XmlPullParserException - when an unrecoverable error occursjava.io.IOException - when an IO error occursprivate void processTag(Dsmlv2Container container, int tagType) throws org.xmlpull.v1.XmlPullParserException
container - the DSML containertagType - the tag typeorg.xmlpull.v1.XmlPullParserException - when an error occurs during the parsing