public abstract class OdfElement extends ElementNSImpl
localName, namespaceURIattributes, namefirstChild, fNodeListCache, ownerDocumentnextSibling, previousSiblingDOCUMENT_POSITION_CONTAINS, DOCUMENT_POSITION_DISCONNECTED, DOCUMENT_POSITION_FOLLOWING, DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC, DOCUMENT_POSITION_IS_CONTAINED, DOCUMENT_POSITION_PRECEDING, ELEMENT_DEFINITION_NODE, FIRSTCHILD, flags, HASSTRING, ID, IGNORABLEWS, NORMALIZED, OWNED, ownerNode, READONLY, SPECIFIED, SYNCCHILDREN, SYNCDATA, TREE_POSITION_ANCESTOR, TREE_POSITION_DESCENDANT, TREE_POSITION_DISCONNECTED, TREE_POSITION_EQUIVALENT, TREE_POSITION_FOLLOWING, TREE_POSITION_PRECEDING, TREE_POSITION_SAME_NODEATTRIBUTE_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_NODEDERIVATION_EXTENSION, DERIVATION_LIST, DERIVATION_RESTRICTION, DERIVATION_UNION| Constructor and Description |
|---|
OdfElement(OdfFileDom ownerDocument,
OdfName aName)
Creates a new instance of OdfElement
|
OdfElement(OdfFileDom ownerDocument,
String namespaceURI,
String qualifiedName)
Creates a new instance of OdfElement
|
| Modifier and Type | Method and Description |
|---|---|
void |
accept(ElementVisitor visitor)
Accept an visitor instance to allow the visitor to do some operations.
|
Node |
cloneNode(boolean deep) |
protected OdfElement |
cloneOdfElement() |
boolean |
equals(Object obj)
indicates if some other object is equal to this one.
|
static <T extends OdfElement> |
findFirstChildNode(Class<T> clazz,
Node parentNode)
returns the first child node that implements the given class.
|
static <T extends OdfElement> |
findNextChildNode(Class<T> clazz,
Node refNode)
returns the first sibling after the given reference node that implements
the given class.
|
static <T extends OdfElement> |
findPreviousChildNode(Class<T> clazz,
Node refNode)
returns the first previous sibling before the given reference node that
implements the given class.
|
protected <T extends OdfElement> |
getAncestorAs(Class<T> clazz) |
OdfAttribute |
getOdfAttribute(NamespaceName namespace,
String localname)
Retrieves an ODF attribute by
NamespaceName, and local name. |
OdfAttribute |
getOdfAttribute(OdfName name)
Retrieves an ODF attribute by
OdfName. |
String |
getOdfAttributeValue(OdfName name)
Retrieves a value of an ODF attribute by
OdfName. |
abstract OdfName |
getOdfName() |
protected <T extends OdfElement> |
getParentAs(Class<T> clazz) |
boolean |
hasOdfAttribute(OdfName name)
Determines if an ODF attribute exists.
|
Node |
insertBefore(Node newChild,
Node refChild) |
protected void |
onInsertNode() |
protected void |
onInsertNode(Node node) |
protected void |
onRemoveNode() |
protected void |
onRemoveNode(Node node) |
Node |
removeChild(Node oldChild) |
Node |
replaceChild(Node newChild,
Node oldChild) |
void |
setOdfAttribute(OdfAttribute attribute)
Set an ODF attribute to this element
|
void |
setOdfAttributeValue(OdfName name,
String value)
Set the value of an ODF attribute by
OdfName. |
String |
toString() |
getLocalName, getNamespaceURI, getPrefix, getTypeName, getTypeNamespace, getXMLBaseAttribute, isDerivedFrom, setPrefix, setTypegetAttribute, getAttributeNode, getAttributeNodeNS, getAttributeNS, getAttributes, getBaseURI, getChildElementCount, getDefaultAttributes, getElementsByTagName, getElementsByTagNameNS, getFirstElementChild, getLastElementChild, getNextElementSibling, getNodeName, getNodeType, getPreviousElementSibling, getSchemaTypeInfo, getTagName, getXercesAttribute, hasAttribute, hasAttributeNS, hasAttributes, isEqualNode, normalize, reconcileDefaultAttributes, removeAttribute, removeAttributeNode, removeAttributeNS, setAttribute, setAttributeNode, setAttributeNodeNS, setAttributeNS, setIdAttribute, setIdAttributeNode, setIdAttributeNS, setOwnerDocument, setReadOnly, setupDefaultAttributes, setXercesAttributeNode, synchronizeDatagetChildNodes, getChildNodesUnoptimized, getFirstChild, getLastChild, getLength, getOwnerDocument, getTextContent, hasChildNodes, item, setTextContent, synchronizeChildrengetNextSibling, getParentNode, getPreviousSiblingaddEventListener, appendChild, changed, changes, compareDocumentPosition, compareTreePosition, dispatchEvent, getContainer, getFeature, getNodeNumber, getNodeValue, getReadOnly, getUserData, getUserData, getUserDataRecord, isDefaultNamespace, isSameNode, isSupported, lookupNamespaceURI, lookupPrefix, needsSyncChildren, removeEventListener, setNodeValue, setUserData, setUserDataclone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitappendChild, compareDocumentPosition, getChildNodes, getFeature, getFirstChild, getLastChild, getNextSibling, getNodeValue, getOwnerDocument, getParentNode, getPreviousSibling, getTextContent, getUserData, hasChildNodes, isDefaultNamespace, isSameNode, isSupported, lookupNamespaceURI, lookupPrefix, setNodeValue, setTextContent, setUserDatapublic OdfElement(OdfFileDom ownerDocument, String namespaceURI, String qualifiedName) throws DOMException
DOMExceptionpublic OdfElement(OdfFileDom ownerDocument, OdfName aName) throws DOMException
DOMExceptionpublic abstract OdfName getOdfName()
protected <T extends OdfElement> T getParentAs(Class<T> clazz)
protected <T extends OdfElement> T getAncestorAs(Class<T> clazz)
public void setOdfAttributeValue(OdfName name, String value)
OdfName.name - The qualified name of the ODF attribute.value - The value to be set in String formpublic void setOdfAttribute(OdfAttribute attribute)
attribute - the attribute to be setpublic String getOdfAttributeValue(OdfName name)
OdfName.name - The qualified name of the ODF attribute.String or
null if the attribute does not exist.public OdfAttribute getOdfAttribute(OdfName name)
OdfName.name - The qualified name of the ODF attribute.OdfAttribute or null if the
attribute does not exist.public OdfAttribute getOdfAttribute(NamespaceName namespace, String localname)
NamespaceName, and local name.namespace - The namespace of the ODF attribute.localname - The local name of the ODF attribute.OdfAttribute or null if the
attribute does not exist.public boolean hasOdfAttribute(OdfName name)
name - The qualified name of the ODF attribute.public static <T extends OdfElement> T findFirstChildNode(Class<T> clazz, Node parentNode)
T - The type of the ODF element to be found.clazz - is a class that extends OdfElement.parentNode - is the parent O of the children to be found.public static <T extends OdfElement> T findNextChildNode(Class<T> clazz, Node refNode)
T - The type of the ODF element to be found.clazz - is a class that extends OdfElement.refNode - the reference node of the siblings to be found.public static <T extends OdfElement> T findPreviousChildNode(Class<T> clazz, Node refNode)
clazz - is a class that extends OdfElement.refNode - the reference node which siblings are to be searched.protected OdfElement cloneOdfElement()
public Node cloneNode(boolean deep)
cloneNode in interface NodecloneNode in class ElementImplpublic boolean equals(Object obj)
protected void onRemoveNode(Node node)
protected void onInsertNode(Node node)
protected void onRemoveNode()
protected void onInsertNode()
public Node insertBefore(Node newChild, Node refChild) throws DOMException
insertBefore in interface NodeinsertBefore in class ParentNodeDOMExceptionpublic Node removeChild(Node oldChild) throws DOMException
removeChild in interface NoderemoveChild in class ParentNodeDOMExceptionpublic Node replaceChild(Node newChild, Node oldChild) throws DOMException
replaceChild in interface NodereplaceChild in class ParentNodeDOMExceptionpublic void accept(ElementVisitor visitor)
visitor - an instance of DefaultElementVisitorCopyright © 2008–2018 Apache Software Foundation; Copyright © 2018–2019 The Document Foundation. All rights reserved.