org.exist.memtree
Class ElementImpl

java.lang.Object
  extended by org.exist.memtree.NodeImpl
      extended by org.exist.memtree.ElementImpl
All Implemented Interfaces:
java.lang.Comparable<java.lang.Object>, ElementAtExist, NodeAtExist, QNameable, Item, NodeValue, Sequence, org.w3c.dom.Element, org.w3c.dom.Node

public class ElementImpl
extends NodeImpl
implements ElementAtExist


Field Summary
 
Fields inherited from class org.exist.memtree.NodeImpl
document, NAMESPACE_NODE, nodeNumber, REFERENCE_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
 
Fields inherited from interface org.exist.xquery.value.NodeValue
IN_MEMORY_NODE, PERSISTENT_NODE
 
Fields inherited from interface org.exist.xquery.value.Sequence
EMPTY_SEQUENCE
 
Constructor Summary
ElementImpl(DocumentImpl doc, int nodeNumber)
           
 
Method Summary
protected  XmldbURI calculateBaseURI()
           
 boolean declaresNamespacePrefixes()
          The method declaresNamespacePrefixes.
 java.lang.String getAttribute(java.lang.String name)
           
 org.w3c.dom.Attr getAttributeNode(java.lang.String name)
           
 org.w3c.dom.Attr getAttributeNodeNS(java.lang.String namespaceURI, java.lang.String localName)
           
 java.lang.String getAttributeNS(java.lang.String namespaceURI, java.lang.String localName)
           
 org.w3c.dom.NamedNodeMap getAttributes()
           
 int getAttributesCount()
           
 java.lang.String getBaseURI()
           
 int getChildCount()
           
 org.w3c.dom.NodeList getChildNodes()
           
 org.w3c.dom.NodeList getElementsByTagName(java.lang.String name)
           
 org.w3c.dom.NodeList getElementsByTagNameNS(java.lang.String namespaceURI, java.lang.String name)
           
 org.w3c.dom.Node getFirstChild()
           
 NodeImpl getFirstChild(NodeTest test)
           
 int getItemType()
          Return the primary type to which all items in this sequence belong.
 java.lang.String getLocalName()
           
 java.lang.String getNamespaceForPrefix(java.lang.String name)
          The method getNamespaceForPrefix.
 java.util.Map<java.lang.String,java.lang.String> getNamespaceMap()
          The method getNamespaceMap.
 java.lang.String getNamespaceURI()
           
 java.lang.String getNodeValue()
           
 java.lang.String getPrefix()
           
 java.util.Set<java.lang.String> getPrefixes()
          The method getPrefixes.
 QName getQName()
           
 org.w3c.dom.TypeInfo getSchemaTypeInfo()
          ? @see org.w3c.dom.Element#getSchemaTypeInfo()
 java.lang.String getTagName()
           
 boolean hasAttribute(java.lang.String name)
           
 boolean hasAttributeNS(java.lang.String namespaceURI, java.lang.String localName)
           
 boolean hasAttributes()
           
 boolean hasChildNodes()
           
 void removeAttribute(java.lang.String arg0)
           
 org.w3c.dom.Attr removeAttributeNode(org.w3c.dom.Attr arg0)
           
 void removeAttributeNS(java.lang.String arg0, java.lang.String arg1)
           
 void selectAttributes(NodeTest test, Sequence result)
           
 void selectChildren(NodeTest test, Sequence result)
           
 void selectDescendantAttributes(NodeTest test, Sequence result)
           
 void selectDescendants(boolean includeSelf, NodeTest test, Sequence result)
           
 void setAttribute(java.lang.String name, java.lang.String value)
           
 org.w3c.dom.Attr setAttributeNode(org.w3c.dom.Attr arg0)
           
 org.w3c.dom.Attr setAttributeNodeNS(org.w3c.dom.Attr arg0)
           
 void setAttributeNS(java.lang.String arg0, java.lang.String arg1, java.lang.String arg2)
           
 void setIdAttribute(java.lang.String name, boolean isId)
          ? @see org.w3c.dom.Element#setIdAttribute(java.lang.String, boolean)
 void setIdAttributeNode(org.w3c.dom.Attr idAttr, boolean isId)
          ? @see org.w3c.dom.Element#setIdAttributeNode(org.w3c.dom.Attr, boolean)
 void setIdAttributeNS(java.lang.String namespaceURI, java.lang.String localName, boolean isId)
          ? @see org.w3c.dom.Element#setIdAttributeNS(java.lang.String, java.lang.String, boolean)
 void setTextContent(java.lang.String textContent)
          ? @see org.w3c.dom.Node#setTextContent(java.lang.String)
 java.lang.String toString()
           
 
Methods inherited from class org.exist.memtree.NodeImpl
add, addAll, addContextNode, after, appendChild, atomize, before, clearContext, cloneNode, compareDocumentPosition, compareTo, conversionPreference, convertTo, copyTo, deepCopy, effectiveBooleanValue, equals, equals, expand, getCardinality, getCollectionIterator, getDocument, getDocumentAtExist, getDocumentSet, getFeature, getImplementationType, getItemCount, getLastChild, getLength, getNextSibling, getNode, getNodeId, getNodeName, getNodeNumber, getNodeType, getOwnerDocument, getParentNode, getPreviousSibling, getState, getStringValue, getTextContent, getType, getUserData, hasChanged, hasMany, hasOne, insertBefore, isCacheable, isCached, isDefaultNamespace, isEmpty, isEqualNode, isPersistentSet, isSameNode, isSupported, itemAt, iterate, lookupNamespaceURI, lookupPrefix, matchAncestors, matchAttributes, matchChildren, matchDescendantAttributes, matchDescendants, matchFollowing, matchFollowingSiblings, matchPreceding, matchPrecedingSiblings, nodeMoved, normalize, removeChild, removeDuplicates, replaceChild, selectAncestors, selectFollowing, selectFollowingSiblings, selectParentNode, selectPreceding, selectPrecedingSiblings, setIsCached, setNodeValue, setPrefix, setSelfAsContext, setUserData, streamTo, toJavaObject, toMemNodeSet, toNodeSet, toSAX, toSequence, unorderedIterator
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.exist.dom.NodeAtExist
getDocumentAtExist, getNodeId, getNodeNumber
 
Methods inherited from interface java.lang.Comparable
compareTo
 
Methods inherited from interface org.w3c.dom.Node
appendChild, cloneNode, compareDocumentPosition, getFeature, getLastChild, getNextSibling, getNodeName, getNodeType, getOwnerDocument, getParentNode, getPreviousSibling, getTextContent, getUserData, insertBefore, isDefaultNamespace, isEqualNode, isSameNode, isSupported, lookupNamespaceURI, lookupPrefix, normalize, removeChild, replaceChild, setNodeValue, setPrefix, setUserData
 

Constructor Detail

ElementImpl

public ElementImpl(DocumentImpl doc,
                   int nodeNumber)
Method Detail

getTagName

public java.lang.String getTagName()
Specified by:
getTagName in interface org.w3c.dom.Element

getQName

public QName getQName()
Specified by:
getQName in interface QNameable
Overrides:
getQName in class NodeImpl

hasChildNodes

public boolean hasChildNodes()
Specified by:
hasChildNodes in interface org.w3c.dom.Node
Overrides:
hasChildNodes in class NodeImpl

getFirstChild

public org.w3c.dom.Node getFirstChild()
Specified by:
getFirstChild in interface org.w3c.dom.Node
Overrides:
getFirstChild in class NodeImpl

getChildNodes

public org.w3c.dom.NodeList getChildNodes()
Specified by:
getChildNodes in interface org.w3c.dom.Node
Overrides:
getChildNodes in class NodeImpl

getChildCount

public int getChildCount()

getNamespaceURI

public java.lang.String getNamespaceURI()
Specified by:
getNamespaceURI in interface org.w3c.dom.Node
Overrides:
getNamespaceURI in class NodeImpl

getPrefix

public java.lang.String getPrefix()
Specified by:
getPrefix in interface org.w3c.dom.Node
Overrides:
getPrefix in class NodeImpl

getLocalName

public java.lang.String getLocalName()
Specified by:
getLocalName in interface org.w3c.dom.Node
Overrides:
getLocalName in class NodeImpl

hasAttributes

public boolean hasAttributes()
Specified by:
hasAttributes in interface org.w3c.dom.Node
Overrides:
hasAttributes in class NodeImpl

getAttribute

public java.lang.String getAttribute(java.lang.String name)
Specified by:
getAttribute in interface org.w3c.dom.Element

setAttribute

public void setAttribute(java.lang.String name,
                         java.lang.String value)
                  throws org.w3c.dom.DOMException
Specified by:
setAttribute in interface org.w3c.dom.Element
Throws:
org.w3c.dom.DOMException

removeAttribute

public void removeAttribute(java.lang.String arg0)
                     throws org.w3c.dom.DOMException
Specified by:
removeAttribute in interface org.w3c.dom.Element
Throws:
org.w3c.dom.DOMException

getAttributesCount

public int getAttributesCount()

getAttributes

public org.w3c.dom.NamedNodeMap getAttributes()
Specified by:
getAttributes in interface org.w3c.dom.Node
Overrides:
getAttributes in class NodeImpl

getAttributeNode

public org.w3c.dom.Attr getAttributeNode(java.lang.String name)
Specified by:
getAttributeNode in interface org.w3c.dom.Element

setAttributeNode

public org.w3c.dom.Attr setAttributeNode(org.w3c.dom.Attr arg0)
                                  throws org.w3c.dom.DOMException
Specified by:
setAttributeNode in interface org.w3c.dom.Element
Throws:
org.w3c.dom.DOMException

removeAttributeNode

public org.w3c.dom.Attr removeAttributeNode(org.w3c.dom.Attr arg0)
                                     throws org.w3c.dom.DOMException
Specified by:
removeAttributeNode in interface org.w3c.dom.Element
Throws:
org.w3c.dom.DOMException

selectAttributes

public void selectAttributes(NodeTest test,
                             Sequence result)
                      throws XPathException
Specified by:
selectAttributes in class NodeImpl
Throws:
XPathException

selectDescendantAttributes

public void selectDescendantAttributes(NodeTest test,
                                       Sequence result)
                                throws XPathException
Specified by:
selectDescendantAttributes in class NodeImpl
Throws:
XPathException

selectChildren

public void selectChildren(NodeTest test,
                           Sequence result)
                    throws XPathException
Specified by:
selectChildren in class NodeImpl
Throws:
XPathException

getFirstChild

public NodeImpl getFirstChild(NodeTest test)
                       throws XPathException
Throws:
XPathException

selectDescendants

public void selectDescendants(boolean includeSelf,
                              NodeTest test,
                              Sequence result)
                       throws XPathException
Overrides:
selectDescendants in class NodeImpl
Throws:
XPathException

getElementsByTagName

public org.w3c.dom.NodeList getElementsByTagName(java.lang.String name)
Specified by:
getElementsByTagName in interface org.w3c.dom.Element

getAttributeNS

public java.lang.String getAttributeNS(java.lang.String namespaceURI,
                                       java.lang.String localName)
Specified by:
getAttributeNS in interface org.w3c.dom.Element

setAttributeNS

public void setAttributeNS(java.lang.String arg0,
                           java.lang.String arg1,
                           java.lang.String arg2)
                    throws org.w3c.dom.DOMException
Specified by:
setAttributeNS in interface org.w3c.dom.Element
Throws:
org.w3c.dom.DOMException

removeAttributeNS

public void removeAttributeNS(java.lang.String arg0,
                              java.lang.String arg1)
                       throws org.w3c.dom.DOMException
Specified by:
removeAttributeNS in interface org.w3c.dom.Element
Throws:
org.w3c.dom.DOMException

getAttributeNodeNS

public org.w3c.dom.Attr getAttributeNodeNS(java.lang.String namespaceURI,
                                           java.lang.String localName)
Specified by:
getAttributeNodeNS in interface org.w3c.dom.Element

setAttributeNodeNS

public org.w3c.dom.Attr setAttributeNodeNS(org.w3c.dom.Attr arg0)
                                    throws org.w3c.dom.DOMException
Specified by:
setAttributeNodeNS in interface org.w3c.dom.Element
Throws:
org.w3c.dom.DOMException

getElementsByTagNameNS

public org.w3c.dom.NodeList getElementsByTagNameNS(java.lang.String namespaceURI,
                                                   java.lang.String name)
Specified by:
getElementsByTagNameNS in interface org.w3c.dom.Element

hasAttribute

public boolean hasAttribute(java.lang.String name)
Specified by:
hasAttribute in interface org.w3c.dom.Element

hasAttributeNS

public boolean hasAttributeNS(java.lang.String namespaceURI,
                              java.lang.String localName)
Specified by:
hasAttributeNS in interface org.w3c.dom.Element

getNamespaceForPrefix

public java.lang.String getNamespaceForPrefix(java.lang.String name)
The method getNamespaceForPrefix.

Parameters:
name - a String value
Returns:
a String value

getPrefixes

public java.util.Set<java.lang.String> getPrefixes()
The method getPrefixes.

Returns:
a Set value

declaresNamespacePrefixes

public boolean declaresNamespacePrefixes()
The method declaresNamespacePrefixes.

Returns:
a boolean value

getNamespaceMap

public java.util.Map<java.lang.String,java.lang.String> getNamespaceMap()
The method getNamespaceMap.

Specified by:
getNamespaceMap in interface ElementAtExist
Returns:
a Map value

getItemType

public int getItemType()
Description copied from interface: Sequence
Return the primary type to which all items in this sequence belong. This is Type.NODE for node sets, Type.ITEM for other sequences with mixed items.

Specified by:
getItemType in interface Sequence
Overrides:
getItemType in class NodeImpl
Returns:
the primary type of the items in this sequence.

getBaseURI

public java.lang.String getBaseURI()
Specified by:
getBaseURI in interface org.w3c.dom.Node
Overrides:
getBaseURI in class NodeImpl

calculateBaseURI

protected XmldbURI calculateBaseURI()
Overrides:
calculateBaseURI in class NodeImpl

getSchemaTypeInfo

public org.w3c.dom.TypeInfo getSchemaTypeInfo()
? @see org.w3c.dom.Element#getSchemaTypeInfo()

Specified by:
getSchemaTypeInfo in interface org.w3c.dom.Element
Returns:
DOCUMENT ME!

setIdAttribute

public void setIdAttribute(java.lang.String name,
                           boolean isId)
                    throws org.w3c.dom.DOMException
? @see org.w3c.dom.Element#setIdAttribute(java.lang.String, boolean)

Specified by:
setIdAttribute in interface org.w3c.dom.Element
Parameters:
name - DOCUMENT ME!
isId - DOCUMENT ME!
Throws:
org.w3c.dom.DOMException - DOCUMENT ME!

setIdAttributeNS

public void setIdAttributeNS(java.lang.String namespaceURI,
                             java.lang.String localName,
                             boolean isId)
                      throws org.w3c.dom.DOMException
? @see org.w3c.dom.Element#setIdAttributeNS(java.lang.String, java.lang.String, boolean)

Specified by:
setIdAttributeNS in interface org.w3c.dom.Element
Parameters:
namespaceURI - DOCUMENT ME!
localName - DOCUMENT ME!
isId - DOCUMENT ME!
Throws:
org.w3c.dom.DOMException - DOCUMENT ME!

setIdAttributeNode

public void setIdAttributeNode(org.w3c.dom.Attr idAttr,
                               boolean isId)
                        throws org.w3c.dom.DOMException
? @see org.w3c.dom.Element#setIdAttributeNode(org.w3c.dom.Attr, boolean)

Specified by:
setIdAttributeNode in interface org.w3c.dom.Element
Parameters:
idAttr - DOCUMENT ME!
isId - DOCUMENT ME!
Throws:
org.w3c.dom.DOMException - DOCUMENT ME!

setTextContent

public void setTextContent(java.lang.String textContent)
                    throws org.w3c.dom.DOMException
Description copied from class: NodeImpl
? @see org.w3c.dom.Node#setTextContent(java.lang.String)

Specified by:
setTextContent in interface org.w3c.dom.Node
Overrides:
setTextContent in class NodeImpl
Parameters:
textContent - DOCUMENT ME!
Throws:
org.w3c.dom.DOMException - DOCUMENT ME!

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getNodeValue

public java.lang.String getNodeValue()
                              throws org.w3c.dom.DOMException
Specified by:
getNodeValue in interface org.w3c.dom.Node
Overrides:
getNodeValue in class NodeImpl
Throws:
org.w3c.dom.DOMException