public final class Item extends AbstractXmlNode implements VoiceXmlNode
| Modifier and Type | Field and Description |
|---|---|
protected static java.util.ArrayList<java.lang.String> |
ATTRIBUTE_NAMES
Supported attribute names for this node.
|
static java.lang.String |
ATTRIBUTE_REPEAT
Defines a legal rule expansion as being another sub-expansion that
is optional, that is repeated zero or more times, that is repeated
one or more times, or that is repeated some range of times.
|
static java.lang.String |
ATTRIBUTE_REPEAT_PROB
Any repeat operator may specify an optional repeat probability.
|
static java.lang.String |
ATTRIBUTE_WEIGHT
A weight may be optionally provided for any number of alternatives
in an alternative expansion.
|
static java.lang.String |
ATTRIBUTE_XML_LANG
The language identifier for the grammar.
|
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 |
|---|
Item()
Construct a new item object without a node.
|
| Modifier and Type | Method and Description |
|---|---|
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.
|
int |
getMaxRepeat()
Retrieves the maximal number of repetitions.
|
int |
getMinRepeat()
Retrieves the minimal number of repetitions.
|
java.lang.String |
getRepeat()
Retrieve the repeat attribute.
|
java.lang.String |
getRepeatProb()
Retrieve the repeatProb attribute.
|
java.lang.String |
getTagName()
Get the name of the tag for the derived node.
|
java.lang.String |
getWeight()
Retrieve the weight attribute.
|
java.lang.String |
getXmlLang()
Retrieve the xmlLang attribute.
|
java.util.Locale |
getXmlLangObject()
Retrieve the xml:lang attribute.
|
boolean |
isOptional()
Checks if this item is optional.This means the value of the repeat
attribute equals
0-1. |
XmlNode |
newInstance(org.w3c.dom.Node n,
XmlNodeFactory<? extends XmlNode> factory)
Create a new instance for the given node.
|
void |
setOptional()
Sets the repeat attribute to optional, this means to a value
0-1. |
void |
setRepeat(int repeat)
Set the repeat attribute.
|
void |
setRepeat(int min,
int max)
Set the repeat attribute.
|
void |
setRepeat(java.lang.String repeat)
Set the repeat attribute.
|
void |
setRepeatProb(java.lang.String repeatProb)
Set the repeatProb attribute.
|
void |
setWeight(java.lang.String weight)
Set the weight attribute.
|
void |
setXmlLang(java.util.Locale locale)
Set the xml:lang attribute.
|
void |
setXmlLang(java.lang.String xmlLang)
Set the xmlLang 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_REPEAT
public static final java.lang.String ATTRIBUTE_REPEAT_PROB
public static final java.lang.String ATTRIBUTE_WEIGHT
public static final java.lang.String ATTRIBUTE_XML_LANG
protected static final java.util.ArrayList<java.lang.String> ATTRIBUTE_NAMES
public Item()
This is necessary for the node factory.
SrgsNodeFactorypublic java.lang.String getTagName()
getTagName in interface XmlNodepublic 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.XmlNodeFactorypublic java.lang.String getRepeat()
ATTRIBUTE_REPEATpublic int getMinRepeat()
public int getMaxRepeat()
-1 if there is no
maximum.public void setRepeat(int repeat)
repeat - number of repetitionsATTRIBUTE_REPEATpublic void setRepeat(int min,
int max)
Throws an IllegalArgumentException for illegal values, i.e.
min < 0 or min < max.
min - minimal number of repetitionsmax - maximal number of repetitions, a value of -1
denotes an infinite maximum.ATTRIBUTE_REPEATpublic void setRepeat(java.lang.String repeat)
repeat - Value of the repeat attribute.ATTRIBUTE_REPEATpublic void setOptional()
0-1.public boolean isOptional()
0-1.true if this item is optional.public java.lang.String getRepeatProb()
ATTRIBUTE_REPEAT_PROBpublic void setRepeatProb(java.lang.String repeatProb)
repeatProb - Value of the repeatProb attribute.ATTRIBUTE_REPEAT_PROBpublic java.lang.String getWeight()
ATTRIBUTE_WEIGHTpublic void setWeight(java.lang.String weight)
weight - Value of the weight attribute.ATTRIBUTE_WEIGHTpublic java.lang.String getXmlLang()
ATTRIBUTE_XML_LANGpublic java.util.Locale getXmlLangObject()
ATTRIBUTE_XML_LANGpublic void setXmlLang(java.lang.String xmlLang)
xmlLang - Value of the xmlLang attribute.ATTRIBUTE_XML_LANGpublic void setXmlLang(java.util.Locale locale)
locale - Value of the xml:lang attribute.ATTRIBUTE_XML_LANGpublic Text addText(java.lang.String text)
text - The text 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