public final class Script extends AbstractXmlNode
A <script> element may occur in the
<vxml> and <form> elements, or in
executable content (in <filled>,
<if>,<block>,
<catch>, or the short forms of
<catch>). Scripts in the <vxml>
element are evaluated just after the document is loaded, along with the
<var> elements, in document order. Scripts in the
<form> element are evaluated in document order, along
with <var> elements and form item variables, each time
execution moves into the <form> element. A
<script> element in executable content is executed, like
other executable elements, as it is encountered.
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
ATTRIBUTE_CHARSET
The character encoding of the script designated by src.
|
static java.lang.String |
ATTRIBUTE_FETCHHINT
Defines when the interpreter context should retrieve content from the
server. prefetch indicates a file may be downloaded when the page is
loaded, whereas safe indicates a file that should only be downloaded when
actually needed.
|
static java.lang.String |
ATTRIBUTE_FETCHTIMEOUT
The interval to wait for the content to be returned before throwing an
error.badfetch event.
|
static java.lang.String |
ATTRIBUTE_MAXAGE
Indicates that the document is willing to use content whose age is no
greater than the specified time in seconds.
|
static java.lang.String |
ATTRIBUTE_MAXSTALE
Indicates that the document is willing to use content that has exceeded
its expiration time.
|
protected static java.util.ArrayList<java.lang.String> |
ATTRIBUTE_NAMES
Supported attribute names for this node.
|
static java.lang.String |
ATTRIBUTE_SRC
The URI specifying the location of the script, if it is external.
|
static java.lang.String |
ATTRIBUTE_SRCEXPR
Equivalent to src, except that the URI is dynamically determined by
evaluating the given ECMAScript expression.
|
static java.lang.String |
TAG_NAME
Name of the 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 |
|---|
Script()
Construct a new script object without a node.
|
| Modifier and Type | Method and Description |
|---|---|
XmlCDataSection |
addCdata(java.lang.String data)
Create a new text within this node.
|
Text |
addText(java.lang.String text)
Create a new text within this node.
|
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 |
getCharset()
Retrieve the charset attribute.
|
java.lang.String |
getFetchhint()
Retrieve the fetchhint attribute.
|
java.lang.String |
getFetchtimeout()
Retrieve the fetchtimeout attribute.
|
java.lang.String |
getMaxage()
Retrieve the maxage attribute.
|
java.lang.String |
getMaxstale()
Retrieve the maxstale attribute.
|
java.lang.String |
getSrc()
Retrieve the src attribute.
|
java.lang.String |
getSrcexpr()
Retrieve the srcexpr attribute.
|
java.net.URI |
getSrcUri()
Retrieve the src attribute.
|
java.lang.String |
getTagName()
Get the name of the tag for the derived node.
|
XmlNode |
newInstance(org.w3c.dom.Node n,
XmlNodeFactory<? extends XmlNode> factory)
Create a new instance for the given node.
|
void |
setCharset(java.lang.String charset)
Set the charset attribute.
|
void |
setFetchhint(java.lang.String fetchhint)
Set the fetchhint attribute.
|
void |
setFetchtimeout(java.lang.String fetchtimeout)
Set the fetchtimeout attribute.
|
void |
setMaxage(java.lang.String maxage)
Set the maxage attribute.
|
void |
setMaxstale(java.lang.String maxstale)
Set the maxstale attribute.
|
void |
setSrc(java.lang.String src)
Set the src attribute.
|
void |
setSrc(java.net.URI uri)
Set the src attribute.
|
void |
setSrcexpr(java.lang.String srcexpr)
Set the srcexpr 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, waitaddChild, 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_SRC
public static final java.lang.String ATTRIBUTE_CHARSET
public static final java.lang.String ATTRIBUTE_FETCHTIMEOUT
public static final java.lang.String ATTRIBUTE_FETCHHINT
public static final java.lang.String ATTRIBUTE_MAXAGE
public static final java.lang.String ATTRIBUTE_MAXSTALE
public static final java.lang.String ATTRIBUTE_SRCEXPR
protected static final java.util.ArrayList<java.lang.String> ATTRIBUTE_NAMES
public Script()
This is necessary for the node factory.
VoiceXmlNodeFactorypublic java.lang.String getTagName()
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.
n - The node to encapsulate.factory - the factroy that calls this method.XmlNodeFactorypublic java.lang.String getSrc()
ATTRIBUTE_SRCpublic java.net.URI getSrcUri()
throws java.net.URISyntaxException
java.net.URISyntaxException - Src attribute does not denote a valid URI.ATTRIBUTE_SRCpublic void setSrc(java.lang.String src)
src - Value of the src attribute.ATTRIBUTE_SRCpublic void setSrc(java.net.URI uri)
uri - Value of the src attribute.ATTRIBUTE_SRCpublic java.lang.String getCharset()
ATTRIBUTE_CHARSETpublic void setCharset(java.lang.String charset)
charset - Value of the charset attribute.ATTRIBUTE_CHARSETpublic java.lang.String getFetchhint()
ATTRIBUTE_FETCHHINTpublic void setFetchhint(java.lang.String fetchhint)
fetchhint - Value of the fetchhint attribute.ATTRIBUTE_FETCHHINTpublic java.lang.String getFetchtimeout()
ATTRIBUTE_FETCHTIMEOUTpublic void setFetchtimeout(java.lang.String fetchtimeout)
fetchtimeout - Value of the fetchtimeout attribute.ATTRIBUTE_FETCHTIMEOUTpublic java.lang.String getMaxage()
ATTRIBUTE_MAXAGEpublic void setMaxage(java.lang.String maxage)
maxage - Value of the maxage attribute.ATTRIBUTE_MAXAGEpublic java.lang.String getMaxstale()
ATTRIBUTE_MAXSTALEpublic void setMaxstale(java.lang.String maxstale)
maxstale - Value of the maxstale attribute.ATTRIBUTE_MAXSTALEpublic java.lang.String getSrcexpr()
ATTRIBUTE_SRCEXPRpublic void setSrcexpr(java.lang.String srcexpr)
srcexpr - Value of the srcexpr attribute.ATTRIBUTE_SRCEXPRpublic Text addText(java.lang.String text)
text - The text to be added.public XmlCDataSection addCdata(java.lang.String data)
data - The data to be added.protected 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