Package org.dom4j.datatype
Class DatatypeElement
- java.lang.Object
-
- org.dom4j.tree.AbstractNode
-
- org.dom4j.tree.AbstractBranch
-
- org.dom4j.tree.AbstractElement
-
- org.dom4j.tree.DefaultElement
-
- org.dom4j.datatype.DatatypeElement
-
- All Implemented Interfaces:
com.sun.msv.datatype.SerializationContext
,Serializable
,Cloneable
,Branch
,Element
,Node
,org.relaxng.datatype.ValidationContext
public class DatatypeElement extends DefaultElement implements com.sun.msv.datatype.SerializationContext, org.relaxng.datatype.ValidationContext
DatatypeElement
represents an Element which supports the XML Schema Data Types specification.- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class org.dom4j.tree.AbstractElement
USE_STRINGVALUE_SEPARATOR, VERBOSE_TOSTRING
-
Fields inherited from class org.dom4j.tree.AbstractBranch
DEFAULT_CONTENT_LIST_SIZE
-
Fields inherited from class org.dom4j.tree.AbstractNode
NODE_TYPE_NAMES
-
Fields inherited from interface org.dom4j.Node
ANY_NODE, ATTRIBUTE_NODE, CDATA_SECTION_NODE, COMMENT_NODE, DOCUMENT_NODE, DOCUMENT_TYPE_NODE, ELEMENT_NODE, ENTITY_REFERENCE_NODE, MAX_NODE_TYPE, NAMESPACE_NODE, PROCESSING_INSTRUCTION_NODE, TEXT_NODE, UNKNOWN_NODE
-
-
Constructor Summary
Constructors Constructor Description DatatypeElement(QName qname, int attributeCount, com.sun.msv.datatype.xsd.XSDatatype type)
DatatypeElement(QName qname, com.sun.msv.datatype.xsd.XSDatatype datatype)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Element
addText(String text)
Adds a newText
node with the given text to this element.protected void
childAdded(Node node)
Override to force lazy recreation of data objectprotected void
childRemoved(Node node)
Override to force lazy recreation of data objectString
getBaseUri()
Object
getData()
Accesses the data of this element which may implement data typing bindings such as XML Schema or Java Bean bindings or will return the same value asElement.getText()
String
getNamespacePrefix(String uri)
com.sun.msv.datatype.xsd.XSDatatype
getXSDatatype()
Returns the MSV XSDatatype for this nodeboolean
isNotation(String notationName)
boolean
isUnparsedEntity(String entityName)
String
resolveNamespacePrefix(String prefix)
void
setData(Object data)
Sets the data value of this element if this element supports data binding or callsNode.setText(java.lang.String)
if it doesn'tvoid
setText(String text)
Sets the text data of this node or this method will throw anUnsupportedOperationException
if it is read-only.String
toString()
protected void
validate(String text)
-
Methods inherited from class org.dom4j.tree.DefaultElement
add, additionalNamespaces, additionalNamespaces, addNewNode, attribute, attribute, attribute, attribute, attributeCount, attributeIterator, attributeList, attributeList, attributes, clearContent, clone, contentList, declaredNamespaces, element, element, element, getDocument, getDocumentFactory, getNamespaceForPrefix, getNamespaceForURI, getParent, getQName, getStringValue, getText, indexOf, node, nodeCount, nodeIterator, processingInstruction, processingInstructions, processingInstructions, remove, removeNode, removeProcessingInstruction, setAttributeList, setAttributes, setContent, setDocument, setParent, setQName, supportsParent
-
Methods inherited from class org.dom4j.tree.AbstractElement
accept, add, add, add, add, add, add, add, add, addAttribute, addAttribute, addCDATA, addComment, addElement, addEntity, addNamespace, addNewNode, addNode, addNode, addProcessingInstruction, addProcessingInstruction, appendAttributes, asXML, attributeValue, attributeValue, attributeValue, attributeValue, createAttributeList, createAttributeList, createCopy, createCopy, createCopy, createElement, createElement, createSingleIterator, elementIterator, elementIterator, elementIterator, elementIterator, elements, elements, elements, elements, elementText, elementText, elementTextTrim, elementTextTrim, ensureAttributesCapacity, getName, getNamespace, getNamespacePrefix, getNamespacesForURI, getNamespaceURI, getNodeType, getPath, getQName, getQualifiedName, getUniquePath, getXPathNameStep, getXPathResult, hasMixedContent, isRootElement, isTextOnly, normalize, remove, remove, remove, remove, remove, remove, remove, remove, setAttributes, setAttributeValue, setAttributeValue, setName, setNamespace, write
-
Methods inherited from class org.dom4j.tree.AbstractBranch
addElement, addElement, addElement, appendContent, content, contentRemoved, createContentList, createContentList, createEmptyList, createResultList, createSingleResultList, elementByID, elementID, getContentAsStringValue, getContentAsText, getTextTrim, hasContent, invalidNodeTypeAddException, isReadOnly, setProcessingInstructions
-
Methods inherited from class org.dom4j.tree.AbstractNode
asXPathResult, createPattern, createXPath, createXPathFilter, createXPathResult, detach, getNodeTypeName, getPath, getUniquePath, matches, numberValueOf, selectNodes, selectNodes, selectNodes, selectObject, selectSingleNode, valueOf
-
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.dom4j.Branch
addElement, addElement, appendContent, content, elementByID, setProcessingInstructions
-
Methods inherited from interface org.dom4j.Element
getTextTrim
-
Methods inherited from interface org.dom4j.Node
asXPathResult, createXPath, detach, getNodeTypeName, getPath, getUniquePath, hasContent, isReadOnly, matches, numberValueOf, selectNodes, selectNodes, selectNodes, selectObject, selectSingleNode, valueOf
-
-
-
-
Method Detail
-
toString
public String toString()
- Overrides:
toString
in classAbstractElement
-
getXSDatatype
public com.sun.msv.datatype.xsd.XSDatatype getXSDatatype()
Returns the MSV XSDatatype for this node- Returns:
- DOCUMENT ME!
-
getNamespacePrefix
public String getNamespacePrefix(String uri)
- Specified by:
getNamespacePrefix
in interfacecom.sun.msv.datatype.SerializationContext
-
getBaseUri
public String getBaseUri()
- Specified by:
getBaseUri
in interfaceorg.relaxng.datatype.ValidationContext
-
isNotation
public boolean isNotation(String notationName)
- Specified by:
isNotation
in interfaceorg.relaxng.datatype.ValidationContext
-
isUnparsedEntity
public boolean isUnparsedEntity(String entityName)
- Specified by:
isUnparsedEntity
in interfaceorg.relaxng.datatype.ValidationContext
-
resolveNamespacePrefix
public String resolveNamespacePrefix(String prefix)
- Specified by:
resolveNamespacePrefix
in interfaceorg.relaxng.datatype.ValidationContext
-
getData
public Object getData()
Description copied from interface:Element
Accesses the data of this element which may implement data typing bindings such as XML Schema or Java Bean bindings or will return the same value asElement.getText()
- Specified by:
getData
in interfaceElement
- Overrides:
getData
in classAbstractElement
- Returns:
- DOCUMENT ME!
-
setData
public void setData(Object data)
Description copied from interface:Element
Sets the data value of this element if this element supports data binding or callsNode.setText(java.lang.String)
if it doesn't- Specified by:
setData
in interfaceElement
- Overrides:
setData
in classAbstractElement
- Parameters:
data
- DOCUMENT ME!
-
addText
public Element addText(String text)
Description copied from interface:Element
Adds a newText
node with the given text to this element.- Specified by:
addText
in interfaceElement
- Overrides:
addText
in classAbstractElement
- Parameters:
text
- is the text for theText
node.- Returns:
- this
Element
instance.
-
setText
public void setText(String text)
Description copied from interface:Node
Sets the text data of this node or this method will throw an
UnsupportedOperationException
if it is read-only.- Specified by:
setText
in interfaceNode
- Overrides:
setText
in classAbstractElement
- Parameters:
text
- is the new textual value of this node
-
childAdded
protected void childAdded(Node node)
Override to force lazy recreation of data object- Overrides:
childAdded
in classAbstractElement
- Parameters:
node
- DOCUMENT ME!
-
childRemoved
protected void childRemoved(Node node)
Override to force lazy recreation of data object- Overrides:
childRemoved
in classAbstractElement
- Parameters:
node
- DOCUMENT ME!
-
validate
protected void validate(String text) throws IllegalArgumentException
- Throws:
IllegalArgumentException
-
-