org.jvoicexml.xml.ccxml
Class Script

java.lang.Object
  extended by org.jvoicexml.xml.AbstractXmlNode
      extended by org.jvoicexml.xml.ccxml.Script
All Implemented Interfaces:
CcxmlNode, XmlNode, XmlWritable, Node

public final class Script
extends AbstractXmlNode

<script> encloses computations written in the ECMAScript Compact Profile scripting language. The ECMAScript Compact Profile is a strict subset of the third edition of ECMA-262. It has been designed to meet the needs of resource-constrained environments. Special attention has been paid to constraining ECMAScript features that require proportionately large amounts of system memory, and continuous or proportionately large amounts of processing power. In particular, it is designed to facilitate prior compilation for execution in a lightweight environment.

Version:
$Revision: 154 $

Copyright © 2005 JVoiceXML group - http://jvoicexml.sourceforge.net/

Author:
Steve Doyle

Field Summary
static String ATTRIBUTE_CHARSET
          A character string that indicates the character encoding type of the script.
static String ATTRIBUTE_FETCHID
          An ECMAScript expression which returns the fetch identifier of a completed fetch request, acquired either in a fetch with the fetchid attribute, or from the fetchid attribute of a fetch.done event.
static String ATTRIBUTE_MAXAGE
          The character string is interpreted as a time interval.
static String ATTRIBUTE_MAXSTALE
          The character string is interpreted as a time interval.
protected static ArrayList<String> ATTRIBUTE_NAMES
          Supported attribute names for this node.
static String ATTRIBUTE_SRC
          A URI which references a resource which is the script content, and which will be resolved when the CCXML document is compiled.
static String ATTRIBUTE_TIMEOUT
          The character string is interpreted as a time interval.
static String TAG_NAME
          Name of the tag.
 
Fields inherited from interface org.w3c.dom.Node
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 Summary
Script()
          Construct a new script object without a node.
 
Method Summary
 Text addText(String text)
          Create a new text within this node.
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.
 String getCharset()
          Retrieve the charset attribute.
 NodeList getChildNodes()
          A NodeList that contains all children of this node.
 String getFetchid()
          Retrieve the fetchid attribute.
 String getMaxage()
          Retrieve the maxage attribute.
 String getMaxstale()
          Retrieve the maxstale attribute.
 String getSrc()
          Retrieve the src attribute.
 String getTagName()
          Get the name of the tag for the derived node.
 String getTimeout()
          Retrieve the timeout attribute.
 XmlNode newInstance(Node n)
          Create a new instance for the given node.
 void setCharset(String charset)
          Set the charset attribute.
 void setFetchid(String fetchid)
          Set the fetchid attribute.
 void setMaxage(String maxage)
          Set the maxage attribute.
 void setMaxstale(String maxstale)
          Set the maxstale attribute.
 void setSrc(String src)
          Set the src attribute.
 void setTimeout(String timeout)
          Set the timeout attribute.
 
Methods inherited from class org.jvoicexml.xml.AbstractXmlNode
addChild, addChild, appendChild, cloneNode, compareDocumentPosition, getAttribute, getAttributes, getBaseURI, getChildNodes, getFeature, getFirstChild, getLastChild, getLocalName, getNamespaceURI, getNextSibling, getNode, getNodeFactory, getNodeName, getNodeType, getNodeValue, getOwnerDocument, getParentNode, getPrefix, getPreviousSibling, getTextContent, getUserData, hasAttributes, hasChildNodes, insertBefore, isDefaultNamespace, isEqualNode, isSameNode, isSupported, lookupNamespaceURI, lookupPrefix, normalize, removeChild, replaceChild, setAttribute, setNodeValue, setPrefix, setTextContent, setUserData, toString, writeChildrenXml, writeXml
 
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, 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

TAG_NAME

public static final String TAG_NAME
Name of the tag.

See Also:
Constant Field Values

ATTRIBUTE_CHARSET

public static final String ATTRIBUTE_CHARSET
A character string that indicates the character encoding type of the script. UTF-8 and UTF-16 encodings of ISO/IEC 10646 must be supported (as in [XML] ) and other encodings, as defined in the [IANA] , may be supported.

See Also:
Constant Field Values

ATTRIBUTE_FETCHID

public static final String ATTRIBUTE_FETCHID
An ECMAScript expression which returns the fetch identifier of a completed fetch request, acquired either in a fetch with the fetchid attribute, or from the fetchid attribute of a fetch.done event. If the fetch identifier is invalid, has not completed, or the fetched content is not valid ECMAScript, an error.semantic event is thrown.

See Also:
Constant Field Values

ATTRIBUTE_MAXAGE

public static final String ATTRIBUTE_MAXAGE
The character string is interpreted as a time interval. This indicates that the document is willing to use content whose age is no greater than the specified time in seconds (cf. 'max-age' in HTTP 1.1 [RFC2616]). The document is not willing to use stale content, unless maxstale is also provided.

See Also:
Constant Field Values

ATTRIBUTE_MAXSTALE

public static final String ATTRIBUTE_MAXSTALE
The character string is interpreted as a time interval. This indicates that the document is willing to use content that has exceeded its expiration time (cf. 'max-age' in HTTP 1.1 [RFC2616]). If maxstale is assigned a value, then the document is willing to accept content that has exceeded its expiration time by no more than the specified number of seconds.

See Also:
Constant Field Values

ATTRIBUTE_SRC

public static final String ATTRIBUTE_SRC
A URI which references a resource which is the script content, and which will be resolved when the CCXML document is compiled. If both the src and fetchid are not present, the script element content provides the script content. If both are present the implementation must throw an error.fetch event. Note that the value of the src attribute is not an ECMAScript expression in order to allow it to be resolved at compile-time. If the script cannot be fetched the implementation must throw an error.fetch event.

See Also:
Constant Field Values

ATTRIBUTE_TIMEOUT

public static final String ATTRIBUTE_TIMEOUT
The character string is interpreted as a time interval. This interval begins when the script is requested; If the script has not been fetched at the end of this interval, an error.fetch event occurs.

See Also:
Constant Field Values

ATTRIBUTE_NAMES

protected static final ArrayList<String> ATTRIBUTE_NAMES
Supported attribute names for this node.

Constructor Detail

Script

public Script()
Construct a new script object without a node.

This is necessary for the node factory.

See Also:
VoiceXmlNodeFactory
Method Detail

getTagName

public String getTagName()
Get the name of the tag for the derived node.

Returns:
name of the tag.

newInstance

public XmlNode newInstance(Node n)
Create a new instance for the given node.

Parameters:
n - The node to encapsulate.
Returns:
The new instance.
See Also:
XmlNodeFactory

getCharset

public String getCharset()
Retrieve the charset attribute.

Returns:
Value of the charset attribute.
See Also:
ATTRIBUTE_CHARSET

setCharset

public void setCharset(String charset)
Set the charset attribute.

Parameters:
charset - Value of the charset attribute.
See Also:
ATTRIBUTE_CHARSET

getFetchid

public String getFetchid()
Retrieve the fetchid attribute.

Returns:
Value of the fetchid attribute.
See Also:
ATTRIBUTE_FETCHID

setFetchid

public void setFetchid(String fetchid)
Set the fetchid attribute.

Parameters:
fetchid - Value of the fetchid attribute.
See Also:
ATTRIBUTE_FETCHID

getMaxage

public String getMaxage()
Retrieve the maxage attribute.

Returns:
Value of the maxage attribute.
See Also:
ATTRIBUTE_MAXAGE

setMaxage

public void setMaxage(String maxage)
Set the maxage attribute.

Parameters:
maxage - Value of the maxage attribute.
See Also:
ATTRIBUTE_MAXAGE

getMaxstale

public String getMaxstale()
Retrieve the maxstale attribute.

Returns:
Value of the maxstale attribute.
See Also:
ATTRIBUTE_MAXSTALE

setMaxstale

public void setMaxstale(String maxstale)
Set the maxstale attribute.

Parameters:
maxstale - Value of the maxstale attribute.
See Also:
ATTRIBUTE_MAXSTALE

getSrc

public String getSrc()
Retrieve the src attribute.

Returns:
Value of the src attribute.
See Also:
ATTRIBUTE_SRC

setSrc

public void setSrc(String src)
Set the src attribute.

Parameters:
src - Value of the src attribute.
See Also:
ATTRIBUTE_SRC

getTimeout

public String getTimeout()
Retrieve the timeout attribute.

Returns:
Value of the timeout attribute.
See Also:
ATTRIBUTE_TIMEOUT

setTimeout

public void setTimeout(String timeout)
Set the timeout attribute.

Parameters:
timeout - Value of the timeout attribute.
See Also:
ATTRIBUTE_TIMEOUT

addText

public Text addText(String text)
Create a new text within this node.

Parameters:
text - The text to be added.
Returns:
The new created text.

canContainChild

protected boolean canContainChild(String tagName)
Can the specified sub-tag be contained within this node?

Specified by:
canContainChild in class AbstractXmlNode
Parameters:
tagName - Name of child.
Returns:
True if the sub-tag is allowed on this node.

getAttributeNames

public Collection<String> getAttributeNames()
Returns a collection of permitted attribute names for the node.

Specified by:
getAttributeNames in interface XmlNode
Overrides:
getAttributeNames in class AbstractXmlNode
Returns:
A collection of attribute names that are allowed for the node

getChildNodes

public final NodeList getChildNodes()
A NodeList that contains all children of this node.

Specified by:
getChildNodes in interface Node
Returns:
NodeList


Copyright © 2005-2007 JVoiceXML group.