Package org.custommonkey.xmlunit
Class NodeTest.NodeTypeNodeFilter
- java.lang.Object
-
- org.custommonkey.xmlunit.NodeTest.NodeTypeNodeFilter
-
- All Implemented Interfaces:
org.w3c.dom.traversal.NodeFilter
- Enclosing class:
- NodeTest
private static class NodeTest.NodeTypeNodeFilter extends java.lang.Object implements org.w3c.dom.traversal.NodeFilter
Node type specific Node Filter: accepts Nodes of those types specified in constructor, rejects all others
-
-
Field Summary
Fields Modifier and Type Field Description private short[]
nodeTypes
-
Fields 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
Constructors Constructor Description NodeTypeNodeFilter(short[] nodeTypes)
Construct filter for specific node types
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description short
acceptNode(org.w3c.dom.Node aNode)
NodeFilter method.private boolean
acceptNodeType(short shortVal)
Does this instance accept nodes with the node type value
-
-
-
Constructor Detail
-
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 Detail
-
acceptNode
public short acceptNode(org.w3c.dom.Node aNode)
NodeFilter method.- Specified by:
acceptNode
in interfaceorg.w3c.dom.traversal.NodeFilter
- Parameters:
aNode
-- Returns:
-
acceptNodeType
private boolean acceptNodeType(short shortVal)
Does this instance accept nodes with the node type value- Parameters:
shortVal
-- Returns:
-
-