|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jvoicexml.xml.AbstractXmlNode
org.jvoicexml.xml.srgs.Grammar
public final class Grammar
The <grammar> element is used to provide a speech grammar that
specifies a set of utterances that a user may speak to perform an action or supply information, and
for a matching utterance, returns a corresponding semantic interpretation. This may be a simple value (such as a string), a flat set of attribute-value pairs (such as day, month, and year), or a nested object (for a complex request).
Copyright © 2005-2007 JVoiceXML group - http://jvoicexml.sourceforge.net/
| Field Summary | |
|---|---|
static String |
ATTRIBUTE_FETCHHINT
This defaults to the grammarfetchhint property. |
static String |
ATTRIBUTE_FETCHTIMEOUT
This defaults to the fetchtimeout property. |
static String |
ATTRIBUTE_MAXAGE
This defaults to the grammarmaxage property. |
static String |
ATTRIBUTE_MAXSTALE
This defaults to the grammarmaxstale property. |
static String |
ATTRIBUTE_MODE
Defines the mode of the grammar following the modes of the W3C Speech Recognition Grammar Specification. |
protected static ArrayList<String> |
ATTRIBUTE_NAMES
Supported attribute names for this node. |
static String |
ATTRIBUTE_ROOT
Defines the rule which acts as the root rule of the grammar. |
static String |
ATTRIBUTE_SCOPE
Either "document", which makes the grammar active in all dialogs of the current document (and relevant application leaf documents), or "dialog", to make the grammar active throughout the current form. |
static String |
ATTRIBUTE_SRC
The URI specifying the location of the grammar and optionally a rulename within that grammar, if it is external. |
static String |
ATTRIBUTE_SRCEXPR
Equivalent to src, except that the URI is dynamically determined by evaluating the given ECMAScript expression in the current scope (e.g. the current form item). |
static String |
ATTRIBUTE_TAG_FORMAT
Defines the tag content format for all tags within the grammar. |
static String |
ATTRIBUTE_TYPE
The preferred media type of the grammar. |
static String |
ATTRIBUTE_VERSION
Defines the version of the grammar. |
static String |
ATTRIBUTE_WEIGHT
Specifies the weight of the grammar. |
static String |
ATTRIBUTE_XML_BASE
Declares the base URI from which relative URIs in the grammar are resolved. |
static String |
ATTRIBUTE_XML_LANG
The language identifier for the grammar. |
static String |
SCOPE_DIALOG
Scope dialog, which makes the grammar active throughout the current form.. |
static String |
SCOPE_DOCUMENT
Scope document, which makes the grammar active in all dialogs of the current document (and relevant application leaf documents). |
static String |
TAG_NAME
Name of the grammar tag. |
| Constructor Summary | |
|---|---|
Grammar()
Construct a new grammar object without a node. |
|
| Method Summary | |
|---|---|
Text |
addText(String text)
Create a new text within this grammar. |
protected boolean |
canContainChild(String tagName)
Can the specified sub-tag be contained within this node? |
Collection<String> |
getAttributeNames()
Returns a collection of permitted attribute names for the node. |
NodeList |
getChildNodes()
A NodeList that contains all children of this node. |
String |
getFetchhint()
Retrieve the fetchhint attribute. |
String |
getFetchtimeout()
Retrieve the fetchtimeout attribute. |
String |
getMaxage()
Retrieve the maxage attribute. |
String |
getMaxstale()
Retrieve the maxstale attribute. |
String |
getMode()
Retrieve the mode attribute. |
String |
getRoot()
Retrieve the root attribute. |
String |
getScope()
Retrieve the scope attribute. |
String |
getSrc()
Retrieve the src attribute. |
String |
getSrcexpr()
Retrieve the srcexpr attribute. |
String |
getTagFormat()
Retrieve the tag-format attribute. |
String |
getTagName()
Get the name of the tag for the derived node. |
GrammarType |
getType()
Retrieves the type attribute. |
String |
getTypename()
Retrieves the type attribute. |
String |
getVersion()
Retrieve the version attribute. |
String |
getWeight()
Retrieve the weight attribute. |
String |
getXmlBase()
Retrieve the xml:base attribute. |
String |
getXmlLang()
Retrieve the xml:lang attribute. |
VoiceXmlNode |
newInstance(Node n)
Create a new instance for the given node. |
void |
setFetchhint(String fetchhint)
Set the fetchhint attribute. |
void |
setFetchtimeout(String fetchtimeout)
Set the fetchtimeout attribute. |
void |
setMaxage(String maxage)
Set the maxage attribute. |
void |
setMaxstale(String maxstale)
Set the maxstale attribute. |
void |
setMode(String mode)
Set the mode attribute. |
void |
setRoot(String root)
Set the root attribute. |
void |
setScope(String scope)
Set the scope attribute. |
void |
setSrc(String src)
Set the src attribute. |
void |
setSrc(URL url)
Set the src attribute to the given URL. |
void |
setSrcexpr(String srcexpr)
Set the srcexpr attribute. |
void |
setTagFormat(String tagFormat)
Set the tag-format attribute. |
void |
setType(GrammarType type)
Sets the type attribute. |
void |
setType(String type)
Sets the type attribute. |
void |
setVersion(String version)
Set the version attribute. |
void |
setWeight(String weight)
Set the weight attribute. |
void |
setXmlBase(String xmlBase)
Set the xml:base attribute. |
void |
setXmlLang(String xmlLang)
Set the xml:lang attribute. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.jvoicexml.xml.XmlNode |
|---|
addChild, getAttribute, getChildNodes, getNode, setAttribute |
| Methods inherited from interface org.jvoicexml.xml.XmlWritable |
|---|
writeChildrenXml, writeXml |
| Methods inherited from interface org.w3c.dom.Node |
|---|
appendChild, cloneNode, compareDocumentPosition, getAttributes, getBaseURI, getChildNodes, getFeature, getFirstChild, getLastChild, getLocalName, getNamespaceURI, getNextSibling, getNodeName, getNodeType, getNodeValue, getOwnerDocument, getParentNode, getPrefix, getPreviousSibling, getTextContent, getUserData, hasAttributes, hasChildNodes, insertBefore, isDefaultNamespace, isEqualNode, isSameNode, isSupported, lookupNamespaceURI, lookupPrefix, normalize, removeChild, replaceChild, setNodeValue, setPrefix, setTextContent, setUserData |
| Field Detail |
|---|
public static final String TAG_NAME
public static final String ATTRIBUTE_VERSION
public static final String ATTRIBUTE_XML_LANG
public static final String ATTRIBUTE_MODE
public static final String ATTRIBUTE_ROOT
public static final String ATTRIBUTE_TAG_FORMAT
public static final String ATTRIBUTE_XML_BASE
<vxml> base URI declaration. If a local declaration
is omitted, the value is inherited down the document hierarchy.
public static final String ATTRIBUTE_SRC
public static final String ATTRIBUTE_SCOPE
SCOPE_DOCUMENT,
SCOPE_DIALOG,
Constant Field Valuespublic static final String SCOPE_DOCUMENT
ATTRIBUTE_SCOPE,
SCOPE_DIALOG,
Constant Field Valuespublic static final String SCOPE_DIALOG
ATTRIBUTE_SCOPE,
SCOPE_DOCUMENT,
Constant Field Valuespublic static final String ATTRIBUTE_TYPE
public static final String ATTRIBUTE_WEIGHT
public static final String ATTRIBUTE_FETCHHINT
public static final String ATTRIBUTE_FETCHTIMEOUT
public static final String ATTRIBUTE_MAXAGE
public static final String ATTRIBUTE_MAXSTALE
public static final String ATTRIBUTE_SRCEXPR
protected static final ArrayList<String> ATTRIBUTE_NAMES
| Constructor Detail |
|---|
public Grammar()
This is necessary for the node factory.
VoiceXmlNodeFactory| Method Detail |
|---|
public String getTagName()
getTagName in interface XmlNodepublic VoiceXmlNode newInstance(Node n)
newInstance in interface XmlNoden - The node to encapsulate.
XmlNodeFactorypublic String getVersion()
ATTRIBUTE_VERSIONpublic void setVersion(String version)
version - Value of the version attribute.ATTRIBUTE_VERSIONpublic String getMode()
ATTRIBUTE_MODEpublic void setMode(String mode)
mode - Value of the mode attribute.ATTRIBUTE_MODEpublic String getRoot()
ATTRIBUTE_ROOTpublic void setRoot(String root)
root - Value of the root attribute.ATTRIBUTE_ROOTpublic String getTagFormat()
ATTRIBUTE_TAG_FORMATpublic void setTagFormat(String tagFormat)
tagFormat - Value of the tag-format attribute.ATTRIBUTE_TAG_FORMATpublic String getXmlLang()
ATTRIBUTE_XML_LANGpublic void setXmlLang(String xmlLang)
xmlLang - Value of the xml:lang attribute.ATTRIBUTE_XML_LANGpublic String getXmlBase()
ATTRIBUTE_XML_BASEpublic void setXmlBase(String xmlBase)
xmlBase - Value of the xml:base attribute.ATTRIBUTE_XML_BASEpublic String getSrc()
ATTRIBUTE_SRCpublic void setSrc(String src)
src - Value of the src attribute.ATTRIBUTE_SRCpublic void setSrc(URL url)
url - URL of the src attribute.ATTRIBUTE_SRCpublic String getScope()
ATTRIBUTE_SCOPEpublic void setScope(String scope)
scope - Value of the scope attribute.ATTRIBUTE_SCOPEpublic String getTypename()
ATTRIBUTE_TYPEpublic GrammarType getType()
ATTRIBUTE_TYPEpublic void setType(String type)
type - Value of the type attribute.ATTRIBUTE_TYPEpublic void setType(GrammarType type)
type - Value of the type attribute.ATTRIBUTE_TYPEpublic String getWeight()
ATTRIBUTE_WEIGHTpublic void setWeight(String weight)
weight - Value of the weight attribute.ATTRIBUTE_WEIGHTpublic String getFetchhint()
ATTRIBUTE_FETCHHINTpublic void setFetchhint(String fetchhint)
fetchhint - Value of the fetchhint attribute.ATTRIBUTE_FETCHHINTpublic String getFetchtimeout()
ATTRIBUTE_FETCHTIMEOUTpublic void setFetchtimeout(String fetchtimeout)
fetchtimeout - Value of the fetchtimeout attribute.ATTRIBUTE_FETCHTIMEOUTpublic String getMaxage()
ATTRIBUTE_MAXAGEpublic void setMaxage(String maxage)
maxage - Value of the maxage attribute.ATTRIBUTE_MAXAGEpublic String getMaxstale()
ATTRIBUTE_MAXSTALEpublic void setMaxstale(String maxstale)
maxstale - Value of the maxstale attribute.ATTRIBUTE_MAXSTALEpublic String getSrcexpr()
ATTRIBUTE_SRCEXPRpublic void setSrcexpr(String srcexpr)
srcexpr - Value of the srcexpr attribute.ATTRIBUTE_SRCEXPRpublic Text addText(String text)
text - The text to be added.
protected boolean canContainChild(String tagName)
canContainChild in class AbstractXmlNodetagName - Name of child.
public Collection<String> getAttributeNames()
getAttributeNames in interface XmlNodegetAttributeNames in class AbstractXmlNodepublic final NodeList getChildNodes()
NodeList that contains all children of this node.
getChildNodes in interface Node
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||