public final class Prompt extends AbstractXmlNode implements TextContainer
<prompt> element controls the output of synthesized
speech and prerecorded audio. Conceptually, prompts are instaneously
queued for play, so interpretation proceeds until the user needs to
provide an input. At this point, the prompts are played, and the system
waits for user input. Once the input is received from the speech
recognition subsystem (or the DTMF recognizer), interpretation
proceeds.| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
ATTRIBUTE_BARGEIN
Control whether the user can interrupt a prompt.
|
static java.lang.String |
ATTRIBUTE_BARGEINTYPE
Sets the type of bargein to be
BARGEIN_TYPE_SPEECH
or BARGEIN_TYPE_HOTWORD. |
static java.lang.String |
ATTRIBUTE_COND
An expression that must evaluate to
true after conversion
to boolean in order for the prompt to be played. |
static java.lang.String |
ATTRIBUTE_COUNT
A number that allows you to emit different prompts if the user is
doing something repeatedly.
|
protected static java.util.ArrayList<java.lang.String> |
ATTRIBUTE_NAMES
Supported attribute names for this node.
|
static java.lang.String |
ATTRIBUTE_TIMEOUT
The timeout that will be used for the following user input.
|
static java.lang.String |
ATTRIBUTE_XML_BASE
Declares the base URI from which relative URIs in the prompt are
resloved.
|
static java.lang.String |
ATTRIBUTE_XML_LANG
The laanguage identifier for the prompt.
|
static java.lang.String |
TAG_NAME
Name of the prompt tag.
|
ATTRIBUTE_NODE, CDATA_SECTION_NODE, COMMENT_NODE, DOCUMENT_FRAGMENT_NODE, DOCUMENT_NODE, DOCUMENT_POSITION_CONTAINED_BY, DOCUMENT_POSITION_CONTAINS, DOCUMENT_POSITION_DISCONNECTED, DOCUMENT_POSITION_FOLLOWING, DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC, DOCUMENT_POSITION_PRECEDING, DOCUMENT_TYPE_NODE, ELEMENT_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE, NOTATION_NODE, PROCESSING_INSTRUCTION_NODE, TEXT_NODE| Constructor and Description |
|---|
Prompt()
Construct a new prompt object without a node.
|
| Modifier and Type | Method and Description |
|---|---|
Text |
addText(java.lang.String text)
Creates a new text within this prompt.
|
protected boolean |
canContainChild(java.lang.String tagName)
Can the specified sub-tag be contained within this node?
|
java.util.Collection<java.lang.String> |
getAttributeNames()
Returns a collection of permitted attribute names for the node.
|
java.lang.String |
getBargein()
Retrieve the bargein attribute.
|
BargeInType |
getBargeintype()
Retrieve the bargeintype attribute.
|
java.lang.String |
getBargeintypeName()
Retrieve the bargeintype attribute.
|
java.lang.String |
getCond()
Retrieve the cond attribute.
|
java.lang.String |
getCount()
Retrieve the count attribute.
|
int |
getCountAsInt()
Retrieve the count attribute.
|
java.lang.String |
getTagName()
Get the name of the tag for the derived node.
|
java.lang.String |
getTimeout()
Retrieve the timeout attribute.
|
long |
getTimeoutAsMsec()
Retrieves the timeout attribute as msec.
|
java.lang.String |
getXmlBase()
Retrieve the xml:base attribute.
|
java.net.URI |
getXmlBaseUri()
Retrieves the xml:base attribute as an URI.
|
java.lang.String |
getXmlLang()
Retrieve the xml:lang attribute.
|
java.util.Locale |
getXmlLangObject()
Retrieve the xml:lang attribute.
|
boolean |
isBargein()
Checks if barge-in is enabled.
|
XmlNode |
newInstance(org.w3c.dom.Node n,
XmlNodeFactory<? extends XmlNode> factory)
Create a new instance for the given node.
|
void |
setBargein(boolean bargein)
Set the bargein attribute.
|
void |
setBargein(java.lang.String bargein)
Set the bargein attribute.
|
void |
setBargeintype(BargeInType bargeintype)
Set the bargeintype attribute.
|
void |
setBargeintype(java.lang.String bargeintype)
Set the bargeintype attribute.
|
void |
setCond(java.lang.String cond)
Set the cond attribute.
|
void |
setCount(int count)
Set the count attribute.
|
void |
setCount(java.lang.String count)
Set the count attribute.
|
void |
setTimeout(java.lang.String timeout)
Set the timeout attribute.
|
void |
setXmlBase(java.lang.String xmlBase)
Set the xml:base attribute.
|
void |
setXmlBase(java.net.URI xmlBase)
Sets the xml:base attribute.
|
void |
setXmlLang(java.util.Locale locale)
Set the xml:lang attribute.
|
void |
setXmlLang(java.lang.String xmlLang)
Set the xml:lang attribute.
|
addChild, addChild, appendChild, appendChild, appendDeepClone, cloneNode, compareDocumentPosition, equals, getAttribute, getAttributes, getBaseURI, getChildNodes, getChildNodes, getChildren, getDefinedAttributeNames, getFeature, getFirstChild, getFirstLevelTextContent, getLastChild, getLocalName, getNamespaceURI, getNextSibling, getNode, getNodeFactory, getNodeName, getNodeType, getNodeValue, getOwnerDocument, getOwnerXmlDocument, getParentNode, getPrefix, getPreviousSibling, getTextContent, getUserData, hasAttribute, hasAttributes, hasChildNodes, hashCode, insertBefore, isDefaultNamespace, isEqualNode, isSameNode, isSupported, lookupNamespaceURI, lookupPrefix, normalize, removeChild, replaceChild, setAttribute, setNodeValue, setPrefix, setTextContent, setUserData, toStringclone, finalize, getClass, notify, notifyAll, wait, wait, waitgetNodeFactoryaddChild, getAttribute, getChildNodes, getChildren, getNode, setAttributeappendChild, 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, setUserDatapublic static final java.lang.String TAG_NAME
public static final java.lang.String ATTRIBUTE_BARGEIN
public static final java.lang.String ATTRIBUTE_BARGEINTYPE
BARGEIN_TYPE_SPEECH
or BARGEIN_TYPE_HOTWORD. This defaults to the value of
the bargein property.public static final java.lang.String ATTRIBUTE_COND
true after conversion
to boolean in order for the prompt to be played. Default is
true.public static final java.lang.String ATTRIBUTE_COUNT
1.public static final java.lang.String ATTRIBUTE_TIMEOUT
public static final java.lang.String ATTRIBUTE_XML_LANG
xml:lang
attribute.public static final java.lang.String ATTRIBUTE_XML_BASE
<vxml> base URI declaration. If a local decalration
is omitted, the value is inherited down the document hierarchie.protected static final java.util.ArrayList<java.lang.String> ATTRIBUTE_NAMES
public Prompt()
This is necessary for the node factory.
VoiceXmlNodeFactorypublic java.lang.String getBargein()
ATTRIBUTE_BARGEINpublic void setBargein(java.lang.String bargein)
bargein - Value of the bargein attribute.ATTRIBUTE_BARGEINpublic boolean isBargein()
true if barge-in is enabled.public void setBargein(boolean bargein)
bargein - Value of the bargein attribute.ATTRIBUTE_BARGEINpublic java.lang.String getBargeintypeName()
ATTRIBUTE_BARGEINTYPEpublic void setBargeintype(java.lang.String bargeintype)
bargeintype - Value of the bargein attribute.ATTRIBUTE_BARGEINpublic BargeInType getBargeintype()
ATTRIBUTE_BARGEINTYPEpublic void setBargeintype(BargeInType bargeintype)
bargeintype - Value of the bargein attribute.ATTRIBUTE_BARGEINpublic java.lang.String getCond()
ATTRIBUTE_CONDpublic void setCond(java.lang.String cond)
cond - Value of the cond attribute.ATTRIBUTE_CONDpublic java.lang.String getCount()
ATTRIBUTE_COUNTpublic void setCount(java.lang.String count)
count - Value of the count attribute.ATTRIBUTE_COUNTpublic int getCountAsInt()
ATTRIBUTE_COUNTpublic void setCount(int count)
count - Value of the count attribute.ATTRIBUTE_COUNTpublic java.lang.String getTimeout()
ATTRIBUTE_TIMEOUTpublic long getTimeoutAsMsec()
-1 if the value can not
be converted to a number.public void setTimeout(java.lang.String timeout)
timeout - Value of the count attribute.ATTRIBUTE_TIMEOUTpublic java.lang.String getXmlLang()
ATTRIBUTE_XML_LANGpublic void setXmlLang(java.lang.String xmlLang)
xmlLang - Value of the xml:lang attribute.ATTRIBUTE_XML_LANGpublic void setXmlLang(java.util.Locale locale)
locale - Value of the xml:lang attribute.ATTRIBUTE_XML_LANGpublic java.util.Locale getXmlLangObject()
ATTRIBUTE_XML_LANGpublic java.lang.String getXmlBase()
ATTRIBUTE_XML_BASEpublic java.net.URI getXmlBaseUri()
throws java.net.URISyntaxException
java.net.URISyntaxException - Value is not a valid URI.ATTRIBUTE_XML_BASEpublic void setXmlBase(java.lang.String xmlBase)
xmlBase - Value of the xml:base attribute.ATTRIBUTE_XML_BASEpublic void setXmlBase(java.net.URI xmlBase)
xmlBase - Value of the xml:base attribute.ATTRIBUTE_XML_BASEpublic java.lang.String getTagName()
getTagName in interface XmlNodepublic Text addText(java.lang.String text)
addText in interface TextContainertext - The text to be added.public XmlNode newInstance(org.w3c.dom.Node n, XmlNodeFactory<? extends XmlNode> factory)
Each XmlNode can serve as a prototype in a
XmlNodeFactory to produce a collection of
child nodes. Factories can then use the prototype pattern to
produce new nodes.
newInstance in interface XmlNoden - The node to encapsulate.factory - the factroy that calls this method.XmlNodeFactoryprotected boolean canContainChild(java.lang.String tagName)
canContainChild in class AbstractXmlNodetagName - Name of child.public java.util.Collection<java.lang.String> getAttributeNames()
getAttributeNames in interface XmlNodegetAttributeNames in class AbstractXmlNode