Package org.ametys.core.util.dom
Class AbstractAmetysElement
- java.lang.Object
-
- org.ametys.core.util.dom.AbstractAmetysNode
-
- org.ametys.core.util.dom.AbstractAmetysElement
-
- Direct Known Subclasses:
AbstractWrappingAmetysElement
,EmptyElement
,MapElement
,OdfReferenceTableElement
,StringElement
public abstract class AbstractAmetysElement extends AbstractAmetysNode implements Element
Basic implementation ofElement
.
-
-
Field Summary
Fields Modifier and Type Field Description protected Element
_parent
The parent Element or null if none.-
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 AbstractAmetysElement()
Constructor.AbstractAmetysElement(String tagName)
Constructor.AbstractAmetysElement(String tagName, Element parent)
Constructor.AbstractAmetysElement(Element parent)
Constructor.
-
Method Summary
-
Methods inherited from class org.ametys.core.util.dom.AbstractAmetysNode
_getChildNodes, appendChild, cloneNode, compareDocumentPosition, getBaseURI, getChildNodes, getFeature, getFirstChild, getLastChild, getNamespaceURI, getNextSibling, getNodeValue, getOwnerDocument, getPrefix, getPreviousSibling, getUserData, hasChildNodes, insertBefore, isDefaultNamespace, isEqualNode, isSameNode, isSupported, lookupNamespaceURI, lookupPrefix, normalize, removeChild, replaceChild, setNodeValue, setPrefix, setTextContent, setUserData
-
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
appendChild, cloneNode, compareDocumentPosition, getBaseURI, getChildNodes, getFeature, getFirstChild, getLastChild, getNamespaceURI, getNextSibling, getNodeValue, getOwnerDocument, getPrefix, getPreviousSibling, getUserData, hasChildNodes, insertBefore, isDefaultNamespace, isEqualNode, isSameNode, isSupported, lookupNamespaceURI, lookupPrefix, normalize, removeChild, replaceChild, setNodeValue, setPrefix, setTextContent, setUserData
-
-
-
-
Constructor Detail
-
AbstractAmetysElement
public AbstractAmetysElement()
Constructor.
-
AbstractAmetysElement
public AbstractAmetysElement(String tagName)
Constructor.- Parameters:
tagName
- the tag name.
-
AbstractAmetysElement
public AbstractAmetysElement(Element parent)
Constructor.- Parameters:
parent
- the parentElement
, if any.
-
AbstractAmetysElement
public AbstractAmetysElement(String tagName, Element parent)
Constructor.- Parameters:
tagName
- the tag name.parent
- the parentElement
, if any.
-
-
Method Detail
-
getTagName
public String getTagName()
- Specified by:
getTagName
in interfaceElement
-
getNodeName
public String getNodeName()
- Specified by:
getNodeName
in interfaceNode
-
getLocalName
public String getLocalName()
- Specified by:
getLocalName
in interfaceNode
- Overrides:
getLocalName
in classAbstractAmetysNode
-
getNodeType
public short getNodeType()
- Specified by:
getNodeType
in interfaceNode
-
getParentNode
public Node getParentNode()
- Specified by:
getParentNode
in interfaceNode
- Overrides:
getParentNode
in classAbstractAmetysNode
-
getAttributes
public NamedNodeMap getAttributes()
- Specified by:
getAttributes
in interfaceNode
- Overrides:
getAttributes
in classAbstractAmetysNode
-
getAttribute
public String getAttribute(String name)
- Specified by:
getAttribute
in interfaceElement
-
getAttributeNode
public Attr getAttributeNode(String name)
- Specified by:
getAttributeNode
in interfaceElement
-
getAttributeNS
public String getAttributeNS(String namespaceURI, String localName) throws DOMException
- Specified by:
getAttributeNS
in interfaceElement
- Throws:
DOMException
-
getAttributeNodeNS
public Attr getAttributeNodeNS(String namespaceURI, String localName) throws DOMException
- Specified by:
getAttributeNodeNS
in interfaceElement
- Throws:
DOMException
-
hasAttributes
public boolean hasAttributes()
- Specified by:
hasAttributes
in interfaceNode
- Overrides:
hasAttributes
in classAbstractAmetysNode
-
hasAttribute
public boolean hasAttribute(String name)
- Specified by:
hasAttribute
in interfaceElement
-
hasAttributeNS
public boolean hasAttributeNS(String namespaceURI, String localName) throws DOMException
- Specified by:
hasAttributeNS
in interfaceElement
- Throws:
DOMException
-
getTextContent
public String getTextContent() throws DOMException
- Specified by:
getTextContent
in interfaceNode
- Throws:
DOMException
-
_lookupAttributes
protected abstract Map<String,AmetysAttribute> _lookupAttributes()
Returns a Map<name, value> corresponding to the attributes.- Returns:
- the name/value pairs
-
getSchemaTypeInfo
public TypeInfo getSchemaTypeInfo()
- Specified by:
getSchemaTypeInfo
in interfaceElement
-
getElementsByTagName
public NodeList getElementsByTagName(String name)
- Specified by:
getElementsByTagName
in interfaceElement
-
getElementsByTagNameNS
public NodeList getElementsByTagNameNS(String namespaceURI, String localName) throws DOMException
- Specified by:
getElementsByTagNameNS
in interfaceElement
- Throws:
DOMException
-
setAttribute
public void setAttribute(String name, String value) throws DOMException
- Specified by:
setAttribute
in interfaceElement
- Throws:
DOMException
-
removeAttribute
public void removeAttribute(String name) throws DOMException
- Specified by:
removeAttribute
in interfaceElement
- Throws:
DOMException
-
setAttributeNode
public Attr setAttributeNode(Attr newAttr) throws DOMException
- Specified by:
setAttributeNode
in interfaceElement
- Throws:
DOMException
-
removeAttributeNode
public Attr removeAttributeNode(Attr oldAttr) throws DOMException
- Specified by:
removeAttributeNode
in interfaceElement
- Throws:
DOMException
-
setAttributeNS
public void setAttributeNS(String namespaceURI, String qualifiedName, String value) throws DOMException
- Specified by:
setAttributeNS
in interfaceElement
- Throws:
DOMException
-
removeAttributeNS
public void removeAttributeNS(String namespaceURI, String localName) throws DOMException
- Specified by:
removeAttributeNS
in interfaceElement
- Throws:
DOMException
-
setAttributeNodeNS
public Attr setAttributeNodeNS(Attr newAttr) throws DOMException
- Specified by:
setAttributeNodeNS
in interfaceElement
- Throws:
DOMException
-
setIdAttribute
public void setIdAttribute(String name, boolean isId) throws DOMException
- Specified by:
setIdAttribute
in interfaceElement
- Throws:
DOMException
-
setIdAttributeNS
public void setIdAttributeNS(String namespaceURI, String localName, boolean isId) throws DOMException
- Specified by:
setIdAttributeNS
in interfaceElement
- Throws:
DOMException
-
setIdAttributeNode
public void setIdAttributeNode(Attr idAttr, boolean isId) throws DOMException
- Specified by:
setIdAttributeNode
in interfaceElement
- Throws:
DOMException
-
-