org.odftoolkit.odfdom.pkg
public abstract class OdfElement extends ElementNSImpl
localName, namespaceURI
attributes, name
firstChild, fNodeListCache, ownerDocument
nextSibling, previousSibling
DOCUMENT_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_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
DERIVATION_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) |
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() |
getBaseURI, getLocalName, getNamespaceURI, getPrefix, getTypeName, getTypeNamespace, isDerivedFrom, setPrefix, setType, setValues
getAttribute, getAttributeNode, getAttributeNodeNS, getAttributeNS, getAttributes, getDefaultAttributes, getElementsByTagName, getElementsByTagNameNS, getNodeName, getNodeType, getSchemaTypeInfo, getTagName, getXercesAttribute, hasAttribute, hasAttributeNS, hasAttributes, isEqualNode, normalize, reconcileDefaultAttributes, removeAttribute, removeAttributeNode, removeAttributeNS, setAttribute, setAttributeNode, setAttributeNodeNS, setAttributeNS, setIdAttribute, setIdAttributeNode, setIdAttributeNS, setOwnerDocument, setReadOnly, setupDefaultAttributes, setXercesAttributeNode, synchronizeData
getChildNodes, getChildNodesUnoptimized, getFirstChild, getLastChild, getLength, getOwnerDocument, getTextContent, hasChildNodes, item, setTextContent, synchronizeChildren
getNextSibling, getParentNode, getPreviousSibling
addEventListener, appendChild, changed, changes, compareDocumentPosition, compareTreePosition, dispatchEvent, getContainer, getFeature, getNodeNumber, getNodeValue, getReadOnly, getUserData, getUserData, getUserDataRecord, isDefaultNamespace, isSameNode, isSupported, lookupNamespaceURI, lookupPrefix, needsSyncChildren, removeEventListener, setNodeValue, setUserData, setUserData
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
appendChild, compareDocumentPosition, getChildNodes, getFeature, getFirstChild, getLastChild, getNextSibling, getNodeValue, getOwnerDocument, getParentNode, getPreviousSibling, getTextContent, getUserData, hasChildNodes, isDefaultNamespace, isSameNode, isSupported, lookupNamespaceURI, lookupPrefix, setNodeValue, setTextContent, setUserData
public OdfElement(OdfFileDom ownerDocument, String namespaceURI, String qualifiedName) throws DOMException
DOMException
public OdfElement(OdfFileDom ownerDocument, OdfName aName) throws DOMException
DOMException
public 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.public Node cloneNode(boolean deep)
cloneNode
in interface Node
cloneNode
in class ElementImpl
public 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 Node
insertBefore
in class ParentNode
DOMException
public Node removeChild(Node oldChild) throws DOMException
removeChild
in interface Node
removeChild
in class ParentNode
DOMException
public Node replaceChild(Node newChild, Node oldChild) throws DOMException
replaceChild
in interface Node
replaceChild
in class ParentNode
DOMException
public void accept(ElementVisitor visitor)
visitor
- an instance of DefaultElementVisitorCopyright © 2008-2014 The Apache Software Foundation. All Rights Reserved.