Package org.custommonkey.xmlunit
Class NodeTest.NodeTypeNodeFilter
java.lang.Object
org.custommonkey.xmlunit.NodeTest.NodeTypeNodeFilter
- All Implemented Interfaces:
NodeFilter
- Enclosing class:
NodeTest
Node type specific Node Filter: accepts Nodes of those types specified
in constructor, rejects all others
-
Field Summary
FieldsFields inherited from interface org.w3c.dom.traversal.NodeFilter
FILTER_ACCEPT, FILTER_REJECT, FILTER_SKIP, SHOW_ALL, SHOW_ATTRIBUTE, SHOW_CDATA_SECTION, SHOW_COMMENT, SHOW_DOCUMENT, SHOW_DOCUMENT_FRAGMENT, SHOW_DOCUMENT_TYPE, SHOW_ELEMENT, SHOW_ENTITY, SHOW_ENTITY_REFERENCE, SHOW_NOTATION, SHOW_PROCESSING_INSTRUCTION, SHOW_TEXT
-
Constructor Summary
ConstructorsConstructorDescriptionNodeTypeNodeFilter
(short[] nodeTypes) Construct filter for specific node types -
Method Summary
Modifier and TypeMethodDescriptionshort
acceptNode
(Node aNode) NodeFilter method.private boolean
acceptNodeType
(short shortVal) Does this instance accept nodes with the node type value
-
Field Details
-
nodeTypes
private final short[] nodeTypes
-
-
Constructor Details
-
NodeTypeNodeFilter
public NodeTypeNodeFilter(short[] nodeTypes) Construct filter for specific node types- Parameters:
nodeTypes
- noteNode.ATTRIBUTE_NODE
is not exposed by the DocumentTraversal node iterator unless the root node is itself an attribute - so a NodeTester that needs to test attributes should obtain those attributes fromNode.ELEMENT_NODE
nodes
-
-
Method Details
-
acceptNode
NodeFilter method.- Specified by:
acceptNode
in interfaceNodeFilter
- Parameters:
aNode
-- Returns:
-
acceptNodeType
private boolean acceptNodeType(short shortVal) Does this instance accept nodes with the node type value- Parameters:
shortVal
-- Returns:
-