|
EAF 7.4 Util | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.enhydra.xml.NodeImpl
org.enhydra.xml.ElementImpl
org.enhydra.xml.HashMapElement
org.enhydra.xml.SearchElement
public class SearchElement
Namespaces are ignored in this implementation. The terms "tag name" and "node name" are always considered to be synonymous.
Field Summary | |
---|---|
static java.lang.String |
ATTR_SEPARATOR
|
static java.lang.String |
EQUAL_SEPARATOR
|
static java.lang.String |
TAG_SEPARATOR
|
Fields inherited from class org.enhydra.xml.HashMapElement |
---|
children |
Fields inherited from class org.enhydra.xml.ElementImpl |
---|
attributes, MASK_NAME, MASK_NAME_START |
Fields inherited from class org.enhydra.xml.NodeImpl |
---|
firstChild, lastChild, nextSibling, nodeName, nodeValue, numChildren, ownerDocument, parent, previousSibling, type |
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 | |
---|---|
SearchElement()
Constructs an empty SearchElement . |
|
SearchElement(org.w3c.dom.Document ownerDoc,
java.lang.String name)
Constructs an SearchElement with a given document owner and node name. |
|
SearchElement(org.w3c.dom.Node node)
Constructs an SearchElement with a given Node . |
|
SearchElement(SearchElement node)
Constructs an SearchElement with a given SearchElement . |
Method Summary | |
---|---|
org.w3c.dom.Element |
getFirstSubElementByTagName(java.lang.String namePath)
Returns the first Element in the subtree of this node,
with the given tag name. |
org.w3c.dom.Element |
getFirstSubElementsByCondition(java.lang.String condition)
Returns the first Element in the subtree of this node,
that satisfy the given condition. |
org.w3c.dom.NodeList |
getSubElementsByAttrValue(java.lang.String attrPath,
java.lang.String attrValue)
Returns a list of Element s in the subtree of this node,
which contain attribute with the given name and value. |
org.w3c.dom.NodeList |
getSubElementsByCondition(java.lang.String condition)
Returns a list of Element s in the subtree of this node,
that satisfy the given condition. |
org.w3c.dom.NodeList |
getSubElementsByTagName(java.lang.String namePath)
Returns a list of elements in the subtree of this node, with the given tag name. |
org.w3c.dom.NodeList |
getSubElementsByTagText(java.lang.String tagPath,
java.lang.String tagValue)
Returns a list of Element s in the subtree of this node,
with the given tag name and value. |
java.lang.String |
getText(java.lang.String namePath)
Return the text of the Element found on the given path. |
protected org.w3c.dom.Node |
newElementInstance(org.w3c.dom.Node node)
Returns new SearchElement instance from a given Node . |
static org.w3c.dom.Element |
newInstance(org.w3c.dom.Document document)
Creates new instance of SearchElement from a given document
as a Document . |
void |
setAttr(java.lang.String namePath,
java.lang.String value)
Sets the value of an attribute found on the given path. |
void |
setText(java.lang.String namePath,
java.lang.String text)
Sets the given text to the Element found on the given path. |
Methods inherited from class org.enhydra.xml.HashMapElement |
---|
cloneNode, getChildrenByTagName, getElementsByTagName, getFirstChildByTagName, getNextSameNameNode, getText, hasElementChildNodes, insertBefore, removeChild, replaceChild, setText |
Methods inherited from class org.enhydra.xml.NodeImpl |
---|
appendChild, getChildNodes, getFirstChild, getLastChild, getLength, getLocalName, getNextSibling, getNodeName, getNodeType, getNodeValue, getOwnerDocument, getParentNode, getPrefix, getPreviousSibling, hasChildNodes, initNodeImplChildren, isSupported, item, newCommentInstance, newDefaultInstance, newTextInstance, normalize, setNodeValue, setPrefix, toString, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.w3c.dom.Node |
---|
appendChild, getChildNodes, getFirstChild, getLastChild, getLocalName, getNextSibling, getNodeName, getNodeType, getNodeValue, getOwnerDocument, getParentNode, getPrefix, getPreviousSibling, hasChildNodes, isSupported, normalize, setNodeValue, setPrefix |
Field Detail |
---|
public static java.lang.String TAG_SEPARATOR
public static java.lang.String ATTR_SEPARATOR
public static java.lang.String EQUAL_SEPARATOR
Constructor Detail |
---|
public SearchElement()
SearchElement
.
public SearchElement(org.w3c.dom.Document ownerDoc, java.lang.String name)
SearchElement
with a given document owner and node name.
ownerDoc
- the document owner of the node, as a Document
.name
- the name of the node, as a String
.public SearchElement(org.w3c.dom.Node node)
SearchElement
with a given Node
.
node
- Node
.public SearchElement(SearchElement node)
SearchElement
with a given SearchElement
.
node
- SearchElement
.Method Detail |
---|
protected org.w3c.dom.Node newElementInstance(org.w3c.dom.Node node)
SearchElement
instance from a given Node
.
newElementInstance
in class HashMapElement
node
- Node
.
public static org.w3c.dom.Element newInstance(org.w3c.dom.Document document)
SearchElement
from a given document
as a Document
.
document
- document.
SearchElement
node as a root of the Document
.public org.w3c.dom.NodeList getSubElementsByTagName(java.lang.String namePath)
namePath
- relative path to the Element (through children).
public org.w3c.dom.NodeList getSubElementsByAttrValue(java.lang.String attrPath, java.lang.String attrValue)
Element
s in the subtree of this node,
which contain attribute with the given name and value.
attrPath
- relative path to the attribute name.attrValue
- attribute value.
Element
s in the subtree of this node,
which contain attribute with the given name and value.public org.w3c.dom.NodeList getSubElementsByTagText(java.lang.String tagPath, java.lang.String tagValue)
Element
s in the subtree of this node,
with the given tag name and value.
tagPath
- relative path to the tag name.tagValue
- Element
value.
Element
s in the subtree of this node,
with the given tag name and value.public org.w3c.dom.NodeList getSubElementsByCondition(java.lang.String condition)
Element
s in the subtree of this node,
that satisfy the given condition.
condition
- condition.
Element
s in the subtree of this node,
that satisfy the given condition.public org.w3c.dom.Element getFirstSubElementsByCondition(java.lang.String condition)
Element
in the subtree of this node,
that satisfy the given condition.
condition
- condition.
Element
in the subtree of this node,
that satisfy the given condition.public org.w3c.dom.Element getFirstSubElementByTagName(java.lang.String namePath)
Element
in the subtree of this node,
with the given tag name.
namePath
- relative path to the Element
.
Element
in the subtree of this node,
with the given tag name.public java.lang.String getText(java.lang.String namePath)
Element
found on the given path.
namePath
- relative path to the Element
node.
Element
found on the given path.public void setText(java.lang.String namePath, java.lang.String text)
Element
found on the given path.
namePath
- relative path to the Element
node.text
- new text.public void setAttr(java.lang.String namePath, java.lang.String value)
namePath
- relative path to the attribute.text
- new value.
|
EAF 7.4 Util | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |