public final class Field extends AbstractXmlNode
<field> specifies an form input item to be gathered
from the user.Form| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
ATTRIBUTE_COND
An expression that must evaluate to true after conversion to boolean
in order for the form item to be visited.
|
static java.lang.String |
ATTRIBUTE_EXPR
The initial value of the form item variable; default is ECMAScript
undefined.
|
static java.lang.String |
ATTRIBUTE_MODAL
If this is false (the default) all active grammars are turned on while
collecting this field.
|
static java.lang.String |
ATTRIBUTE_NAME
The form item variable in the dialog scope that will hold the result.
|
protected static java.util.ArrayList<java.lang.String> |
ATTRIBUTE_NAMES
Supported attribute names for this node.
|
static java.lang.String |
ATTRIBUTE_SLOT
The name of the grammar slot used to populate the variable (if it is
absent, it defaults to the variable name).
|
static java.lang.String |
ATTRIBUTE_TYPE
The type of field, i.e., the name of a builtin grammar type.
|
static java.lang.String |
TAG_NAME
Name of the field 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 |
|---|
Field()
Construct a new field object without a node.
|
Field(org.w3c.dom.Node node)
Constructs a new field object.
|
| 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.
|
java.lang.String |
getCond()
Retrieve the cond attribute.
|
java.lang.String |
getExpr()
Retrieve the expr attribute.
|
java.lang.String |
getModal()
Retrieve the modal attribute.
|
java.lang.String |
getName()
Retrieve the name attribute.
|
java.lang.String |
getSlot()
Retrieve the slot attribute.
|
java.lang.String |
getTagName()
Get the name of the tag for the derived node.
|
java.lang.String |
getType()
Retrieve the type attribute.
|
boolean |
isModal()
Checks if this field is modal.
|
XmlNode |
newInstance(org.w3c.dom.Node n,
XmlNodeFactory<? extends XmlNode> factory)
Create a new instance for the given node.
|
void |
setCond(java.lang.String cond)
Set the cond attribute.
|
void |
setExpr(java.lang.String expr)
Set the expr attribute.
|
void |
setModal(boolean modal)
Set the modal attribute.
|
void |
setModal(java.lang.String modal)
Set the modal attribute.
|
void |
setName(java.lang.String name)
Set the name attribute.
|
void |
setSlot(java.lang.String slot)
Set the slot attribute.
|
void |
setType(java.lang.String type)
Set the type 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_NAME
public static final java.lang.String ATTRIBUTE_EXPR
public static final java.lang.String ATTRIBUTE_COND
public static final java.lang.String ATTRIBUTE_TYPE
public static final java.lang.String ATTRIBUTE_SLOT
public static final java.lang.String ATTRIBUTE_MODAL
protected static final java.util.ArrayList<java.lang.String> ATTRIBUTE_NAMES
public Field()
This is necessary for the node factory.
VoiceXmlNodeFactorypublic Field(org.w3c.dom.Node node)
node - The encapsulated node.public java.lang.String getName()
ATTRIBUTE_NAMEpublic void setName(java.lang.String name)
name - Value of the name attribute.ATTRIBUTE_NAMEpublic java.lang.String getExpr()
ATTRIBUTE_EXPRpublic void setExpr(java.lang.String expr)
expr - Value of the expr attribute.ATTRIBUTE_EXPRpublic java.lang.String getCond()
ATTRIBUTE_CONDpublic void setCond(java.lang.String cond)
cond - Value of the cond attribute.ATTRIBUTE_CONDpublic java.lang.String getType()
ATTRIBUTE_TYPEpublic void setType(java.lang.String type)
type - Value of the type attribute.ATTRIBUTE_TYPEpublic java.lang.String getSlot()
ATTRIBUTE_SLOTpublic void setSlot(java.lang.String slot)
slot - Value of the slot attribute.ATTRIBUTE_SLOTpublic java.lang.String getModal()
ATTRIBUTE_MODALpublic boolean isModal()
true if the field is modal.public void setModal(java.lang.String modal)
modal - Value of the modal attribute.ATTRIBUTE_MODALpublic void setModal(boolean modal)
modal - Value of the modal attribute.ATTRIBUTE_MODALpublic 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 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