public interface NodeFilter
Modifier and Type | Field and Description |
---|---|
static short |
FILTER_ACCEPT
Value returned by the
NodeFilter.acceptNode()
method when a node should be accepted. |
static short |
FILTER_REJECT
Value to be returned by the
NodeFilter.acceptNode()
method when a node should be rejected. |
static short |
FILTER_SKIP
Value to be returned by
NodeFilter.acceptNode()
for nodes to be skipped by the NodeIterator
or TreeWalker
object. |
static int |
SHOW_ALL
Shows all nodes.
|
static int |
SHOW_ATTRIBUTE
Shows attribute
Attr
nodes. |
static int |
SHOW_CDATA_SECTION
Shows
CDATASection
nodes. |
static int |
SHOW_COMMENT
Shows
Comment
nodes. |
static int |
SHOW_DOCUMENT
Shows
Document
nodes. |
static int |
SHOW_DOCUMENT_FRAGMENT
Shows
DocumentFragment
nodes. |
static int |
SHOW_DOCUMENT_TYPE
Shows
DocumentType
nodes. |
static int |
SHOW_ELEMENT
Shows
Element
nodes. |
static int |
SHOW_ENTITY
Shows
Entity
nodes. |
static int |
SHOW_ENTITY_REFERENCE
Shows
EntityReference
nodes. |
static int |
SHOW_NOTATION
Shows
Notation
nodes. |
static int |
SHOW_PROCESSING_INSTRUCTION
Shows
ProcessingInstruction
nodes. |
static int |
SHOW_TEXT
Shows
Text
nodes. |
Modifier and Type | Method and Description |
---|---|
short |
acceptNode(Node n)
The accept node method used by the filter is supplied as an object property when constructing the
NodeIterator
or TreeWalker
. |
static final short FILTER_ACCEPT
NodeFilter.acceptNode()
method when a node should be accepted.static final short FILTER_REJECT
NodeFilter.acceptNode()
method when a node should be rejected. The children of rejected nodes are not visited by the NodeIterator
or TreeWalker
object; this value is treated as "skip this node and all its children".static final short FILTER_SKIP
NodeFilter.acceptNode()
for nodes to be skipped by the NodeIterator
or TreeWalker
object. The children of skipped nodes are still considered. This is treated as "skip this node but not its children".static final int SHOW_ALL
static final int SHOW_ATTRIBUTE
Attr
nodes. This is meaningful only when creating a NodeIterator
or TreeWalker
with an Attr
node as its root; in this case, it means that the attribute node will appear in the first position of the iteration or traversal. Since attributes are never children of other nodes, they do not appear when traversing over the document tree.static final int SHOW_CDATA_SECTION
CDATASection
nodes.static final int SHOW_COMMENT
Comment
nodes.static final int SHOW_DOCUMENT
Document
nodes.static final int SHOW_DOCUMENT_FRAGMENT
DocumentFragment
nodes.static final int SHOW_DOCUMENT_TYPE
DocumentType
nodes.static final int SHOW_ELEMENT
Element
nodes.static final int SHOW_ENTITY
Entity
nodes. This is meaningful only when creating a NodeIterator
or TreeWalker
with an Entity
node as its root; in this case, it means that the Entity
node will appear in the first position of the traversal. Since entities are not part of the document tree, they do not appear when traversing over the document tree.static final int SHOW_ENTITY_REFERENCE
EntityReference
nodes.static final int SHOW_NOTATION
Notation
nodes. This is meaningful only when creating a NodeIterator
or TreeWalker
with a Notation
node as its root; in this case, it means that the Notation
node will appear in the first position of the traversal. Since entities are not part of the document tree, they do not appear when traversing over the document tree.static final int SHOW_PROCESSING_INSTRUCTION
ProcessingInstruction
nodes.static final int SHOW_TEXT
Text
nodes.short acceptNode(Node n)
NodeIterator
or TreeWalker
.Copyright © 2018. All rights reserved.