public abstract class AbstractItem extends java.lang.Object implements Item, org.w3c.dom.Node, java.io.Serializable, java.lang.Cloneable
Important methods that the deriving might want to override.
Item
,
Serialized FormFIND_BY_PREFIX, FIND_BY_REGEX, FIND_BY_TAGNAME, FIND_IGNORE_CASE, FIND_RECURSIVE
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
Modifier | Constructor and Description |
---|---|
protected |
AbstractItem()
Constructor.
|
Modifier and Type | Method and Description |
---|---|
org.w3c.dom.Node |
appendChild(org.w3c.dom.Node newChild) |
java.lang.Object |
clone()
Clones this object (a deep cloning not including contents contained
in Textual nodes).
|
org.w3c.dom.Node |
cloneNode(boolean deep) |
short |
compareDocumentPosition(org.w3c.dom.Node other) |
Item |
detach()
Detach this item from its parent.
|
boolean |
equals(java.lang.Object o)
Overriding this method is prohibited.
|
org.w3c.dom.NamedNodeMap |
getAttributes() |
java.lang.String |
getBaseURI() |
org.w3c.dom.NodeList |
getChildNodes() |
Document |
getDocument()
Gets the document that owns this item.
|
java.lang.Object |
getFeature(java.lang.String feature,
java.lang.String version) |
org.w3c.dom.Node |
getFirstChild() |
org.w3c.dom.Node |
getLastChild() |
java.lang.String |
getLocalName() |
Locator |
getLocator()
Gets the locator of this item.
|
java.lang.String |
getNamespaceURI() |
org.w3c.dom.Node |
getNextSibling() |
java.lang.String |
getNodeName() |
java.lang.String |
getNodeValue() |
org.w3c.dom.Document |
getOwnerDocument() |
Group |
getParent()
Gets the parent item.
|
org.w3c.dom.Node |
getParentNode() |
java.lang.String |
getPrefix() |
org.w3c.dom.Node |
getPreviousSibling() |
java.lang.String |
getText()
|
java.lang.String |
getTextContent() |
java.lang.Object |
getUserData(java.lang.String key) |
boolean |
hasAttributes() |
boolean |
hasChildNodes() |
int |
hashCode()
Overriding this method is prohibited.
|
org.w3c.dom.Node |
insertBefore(org.w3c.dom.Node newChild,
org.w3c.dom.Node refChild) |
boolean |
isDefaultNamespace(java.lang.String namespaceURI) |
boolean |
isEqualNode(org.w3c.dom.Node arg) |
boolean |
isSameNode(org.w3c.dom.Node other) |
boolean |
isSupported(java.lang.String feature,
java.lang.String version) |
java.lang.String |
lookupNamespaceURI(java.lang.String prefix) |
java.lang.String |
lookupPrefix(java.lang.String namespaceURI) |
protected static boolean |
match(Namespaceable vtx,
java.lang.String namespace,
java.lang.String name,
java.util.regex.Pattern ptn,
int mode)
Tests whether a namespaceable item matches the criteria.
|
void |
normalize() |
org.w3c.dom.Node |
removeChild(org.w3c.dom.Node oldChild) |
org.w3c.dom.Node |
replaceChild(org.w3c.dom.Node newChild,
org.w3c.dom.Node oldChild) |
void |
setLocator(Locator loc)
Sets the locator of this item.
|
void |
setName(java.lang.String name)
Sets the name of the item.
|
void |
setNodeValue(java.lang.String nodeValue) |
void |
setParent(Group parent)
Sets the parent item.
|
void |
setPrefix(java.lang.String prefix) |
void |
setText(java.lang.String text)
Sets the text of this item.
|
void |
setTextContent(java.lang.String textContent) |
java.lang.Object |
setUserData(java.lang.String key,
java.lang.Object data,
org.w3c.dom.UserDataHandler handler) |
protected static boolean match(Namespaceable vtx, java.lang.String namespace, java.lang.String name, java.util.regex.Pattern ptn, int mode)
public void setName(java.lang.String name)
Item
setName
in interface Item
Namespaceable.setTagName(java.lang.String)
public java.lang.String getText()
Item
Textual
nor Element
.
For Element, the text is the concatenation of all its textual
children, including Text, CDATA, and Binary.
Besides String-type value, some item, e.g., Binary, allows any type of objects. Caller could test whether a item implements the Binable interface, and use Binable.getValue instead. For binable vertices, getText is actually getValue().toString().
The returned value is neither trimmed nor normalized.
public void setText(java.lang.String text)
Item
public Document getDocument()
Item
getDocument
in interface Item
public Item detach()
Item
Because each item can belong to at most one parent at a time, it is important to detach it first, before added to another tree -- even if it is the same tree/parent.
It has the similar effect as:
getParent().getChildren().remove(this).
Naming reason: we don't call this method as getChildren() to be compatible with the naming style of Attributable.attributes -- which is limited to org.w3c.dom.Attr.getAttributes. Also, it doesn't have the setter and it is "live", so it 'seem' better to call it getChildren().
public final Group getParent()
Item
public void setParent(Group parent)
Item
DO NOT call this method. It is used internally. Instead, use detach or thru getChildren().
public final Locator getLocator()
Item
getLocator
in interface Item
public final void setLocator(Locator loc)
Item
Unlike other methods, it won't change the modification flag.
setLocator
in interface Item
loc
- the locator; null if not availablepublic java.lang.String getNodeName()
getNodeName
in interface org.w3c.dom.Node
public java.lang.String getNodeValue()
getNodeValue
in interface org.w3c.dom.Node
public void setNodeValue(java.lang.String nodeValue)
setNodeValue
in interface org.w3c.dom.Node
public org.w3c.dom.Document getOwnerDocument()
getOwnerDocument
in interface org.w3c.dom.Node
public final org.w3c.dom.Node cloneNode(boolean deep)
cloneNode
in interface org.w3c.dom.Node
public final org.w3c.dom.Node getParentNode()
getParentNode
in interface org.w3c.dom.Node
public final org.w3c.dom.Node getPreviousSibling()
getPreviousSibling
in interface org.w3c.dom.Node
public final org.w3c.dom.Node getNextSibling()
getNextSibling
in interface org.w3c.dom.Node
public org.w3c.dom.NodeList getChildNodes()
getChildNodes
in interface org.w3c.dom.Node
public org.w3c.dom.Node getFirstChild()
getFirstChild
in interface org.w3c.dom.Node
public org.w3c.dom.Node getLastChild()
getLastChild
in interface org.w3c.dom.Node
public boolean hasChildNodes()
hasChildNodes
in interface org.w3c.dom.Node
public org.w3c.dom.Node insertBefore(org.w3c.dom.Node newChild, org.w3c.dom.Node refChild)
insertBefore
in interface org.w3c.dom.Node
public org.w3c.dom.Node replaceChild(org.w3c.dom.Node newChild, org.w3c.dom.Node oldChild)
replaceChild
in interface org.w3c.dom.Node
public org.w3c.dom.Node removeChild(org.w3c.dom.Node oldChild)
removeChild
in interface org.w3c.dom.Node
public org.w3c.dom.Node appendChild(org.w3c.dom.Node newChild)
appendChild
in interface org.w3c.dom.Node
public final void normalize()
normalize
in interface org.w3c.dom.Node
public final boolean isSupported(java.lang.String feature, java.lang.String version)
isSupported
in interface org.w3c.dom.Node
public java.lang.String getNamespaceURI()
getNamespaceURI
in interface org.w3c.dom.Node
public java.lang.String getPrefix()
getPrefix
in interface org.w3c.dom.Node
public java.lang.String getLocalName()
getLocalName
in interface org.w3c.dom.Node
public void setPrefix(java.lang.String prefix)
setPrefix
in interface org.w3c.dom.Node
public org.w3c.dom.NamedNodeMap getAttributes()
getAttributes
in interface org.w3c.dom.Node
public boolean hasAttributes()
hasAttributes
in interface org.w3c.dom.Node
public java.lang.String getBaseURI()
getBaseURI
in interface org.w3c.dom.Node
public short compareDocumentPosition(org.w3c.dom.Node other) throws DOMException
compareDocumentPosition
in interface org.w3c.dom.Node
DOMException
public java.lang.String getTextContent() throws DOMException
getTextContent
in interface org.w3c.dom.Node
DOMException
public void setTextContent(java.lang.String textContent) throws DOMException
setTextContent
in interface org.w3c.dom.Node
DOMException
public boolean isSameNode(org.w3c.dom.Node other)
isSameNode
in interface org.w3c.dom.Node
public java.lang.String lookupPrefix(java.lang.String namespaceURI)
lookupPrefix
in interface org.w3c.dom.Node
public boolean isDefaultNamespace(java.lang.String namespaceURI)
isDefaultNamespace
in interface org.w3c.dom.Node
public java.lang.String lookupNamespaceURI(java.lang.String prefix)
lookupNamespaceURI
in interface org.w3c.dom.Node
public boolean isEqualNode(org.w3c.dom.Node arg)
isEqualNode
in interface org.w3c.dom.Node
public java.lang.Object getFeature(java.lang.String feature, java.lang.String version)
getFeature
in interface org.w3c.dom.Node
public java.lang.Object setUserData(java.lang.String key, java.lang.Object data, org.w3c.dom.UserDataHandler handler)
setUserData
in interface org.w3c.dom.Node
public java.lang.Object getUserData(java.lang.String key)
getUserData
in interface org.w3c.dom.Node
public final boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public final int hashCode()
hashCode
in class java.lang.Object
public java.lang.Object clone()
Copyright © 2005-2011 Potix Corporation. All Rights Reserved.