Package org.ametys.core.util.dom
Class AbstractAmetysNode
- java.lang.Object
-
- org.ametys.core.util.dom.AbstractAmetysNode
-
- All Implemented Interfaces:
Node
- Direct Known Subclasses:
AbstractAmetysElement
,AmetysAttribute
,AmetysText
public abstract class AbstractAmetysNode extends Object implements Node
VERY partial implementation of a read-only, non-namespace awareNode
on top of an objects hierarchy.
It is NOT intended to be used as a full-featured DOM implementation, but it aims to provide a thin DOM layer over objects usable e.g. in XPath expressions and XSL stylesheets.
There's no text nodes, nor entities, documents, ...
-
-
Field Summary
Fields Modifier and Type Field Description private NodeList
_childNodes
-
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
Constructors Constructor Description AbstractAmetysNode()
-
Method Summary
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.w3c.dom.Node
getNodeName, getNodeType, getTextContent
-
-
-
-
Field Detail
-
_childNodes
private NodeList _childNodes
-
-
Constructor Detail
-
AbstractAmetysNode
public AbstractAmetysNode()
-
-
Method Detail
-
getNodeValue
public String getNodeValue() throws DOMException
- Specified by:
getNodeValue
in interfaceNode
- Throws:
DOMException
-
getParentNode
public Node getParentNode()
- Specified by:
getParentNode
in interfaceNode
-
getAttributes
public NamedNodeMap getAttributes()
- Specified by:
getAttributes
in interfaceNode
-
getChildNodes
public NodeList getChildNodes()
- Specified by:
getChildNodes
in interfaceNode
-
_getChildNodes
protected NodeList _getChildNodes()
Actual processing of child nodes. Sublclasses should override this method and not getChildNodes().- Returns:
- a NodeList containing all children.
-
hasChildNodes
public boolean hasChildNodes()
- Specified by:
hasChildNodes
in interfaceNode
-
getNamespaceURI
public String getNamespaceURI()
- Specified by:
getNamespaceURI
in interfaceNode
-
getLocalName
public String getLocalName()
- Specified by:
getLocalName
in interfaceNode
-
hasAttributes
public boolean hasAttributes()
- Specified by:
hasAttributes
in interfaceNode
-
getBaseURI
public String getBaseURI()
- Specified by:
getBaseURI
in interfaceNode
-
getFirstChild
public Node getFirstChild()
- Specified by:
getFirstChild
in interfaceNode
-
getNextSibling
public Node getNextSibling()
- Specified by:
getNextSibling
in interfaceNode
-
getLastChild
public Node getLastChild()
- Specified by:
getLastChild
in interfaceNode
-
getPreviousSibling
public Node getPreviousSibling()
- Specified by:
getPreviousSibling
in interfaceNode
-
getOwnerDocument
public Document getOwnerDocument()
- Specified by:
getOwnerDocument
in interfaceNode
-
setNodeValue
public void setNodeValue(String nodeValue) throws DOMException
- Specified by:
setNodeValue
in interfaceNode
- Throws:
DOMException
-
insertBefore
public Node insertBefore(Node newChild, Node refChild) throws DOMException
- Specified by:
insertBefore
in interfaceNode
- Throws:
DOMException
-
replaceChild
public Node replaceChild(Node newChild, Node oldChild) throws DOMException
- Specified by:
replaceChild
in interfaceNode
- Throws:
DOMException
-
removeChild
public Node removeChild(Node oldChild) throws DOMException
- Specified by:
removeChild
in interfaceNode
- Throws:
DOMException
-
appendChild
public Node appendChild(Node newChild) throws DOMException
- Specified by:
appendChild
in interfaceNode
- Throws:
DOMException
-
isSupported
public boolean isSupported(String feature, String version)
- Specified by:
isSupported
in interfaceNode
-
setPrefix
public void setPrefix(String prefix) throws DOMException
- Specified by:
setPrefix
in interfaceNode
- Throws:
DOMException
-
compareDocumentPosition
public short compareDocumentPosition(Node other) throws DOMException
- Specified by:
compareDocumentPosition
in interfaceNode
- Throws:
DOMException
-
setTextContent
public void setTextContent(String textContent) throws DOMException
- Specified by:
setTextContent
in interfaceNode
- Throws:
DOMException
-
isSameNode
public boolean isSameNode(Node other)
- Specified by:
isSameNode
in interfaceNode
-
lookupPrefix
public String lookupPrefix(String namespaceURI)
- Specified by:
lookupPrefix
in interfaceNode
-
isDefaultNamespace
public boolean isDefaultNamespace(String namespaceURI)
- Specified by:
isDefaultNamespace
in interfaceNode
-
lookupNamespaceURI
public String lookupNamespaceURI(String prefix)
- Specified by:
lookupNamespaceURI
in interfaceNode
-
isEqualNode
public boolean isEqualNode(Node arg)
- Specified by:
isEqualNode
in interfaceNode
-
getFeature
public Object getFeature(String feature, String version)
- Specified by:
getFeature
in interfaceNode
-
setUserData
public Object setUserData(String key, Object data, UserDataHandler handler)
- Specified by:
setUserData
in interfaceNode
-
getUserData
public Object getUserData(String key)
- Specified by:
getUserData
in interfaceNode
-
-