org.jvoicexml.xml.ccxml
Class Script

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

public final class Script
extends CcxmlNode

<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: 1.4 $

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.
private static Set<String> CHILD_TAGS
          Valid child tags for this node.
static String TAG_NAME
          Name of the tag.
 
Fields inherited from class org.jvoicexml.xml.XmlNode
node
 
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.
Script(Node node)
          Construct a new script object.
 
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.
 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.ccxml.CcxmlNode
getChildNodes, getFirstChild, getLastChild, getNextSibling, getParentNode, getPreviousSibling
 
Methods inherited from class org.jvoicexml.xml.XmlNode
addChild, appendChild, cloneNode, compareDocumentPosition, getAttribute, getAttributes, getBaseURI, getChildNodes, getFeature, getLocalName, getNamespaceURI, getNode, getNodeName, getNodeType, getNodeValue, getOwnerDocument, getPrefix, 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
 

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.


CHILD_TAGS

private static final Set<String> CHILD_TAGS
Valid child tags 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

Script

Script(Node node)
Construct a new script object.

Parameters:
node - The encapsulated node.
Method Detail

getTagName

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

Specified by:
getTagName in class XmlNode
Returns:
name of the tag.

newInstance

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

Specified by:
newInstance in class XmlNode
Parameters:
n - The node to encapsulate.
Returns:
The new instance.

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 XmlNode
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.

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


Copyright © 2005 JVoiceXML group.