Package org.custommonkey.xmlunit
Class AbstractNodeTester
- java.lang.Object
-
- org.custommonkey.xmlunit.AbstractNodeTester
-
- All Implemented Interfaces:
NodeTester
public abstract class AbstractNodeTester extends java.lang.Object implements NodeTester
Helper class. Abstract interface implementation that performs Node-type checks and delegates testNode() processing to subclass.- See Also:
NodeTest
-
-
Constructor Summary
Constructors Constructor Description AbstractNodeTester()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidnoMoreNodes(NodeTest forTest)Validate that the Nodes validated one-by-one in theisValidmethod were all the Nodes expected.voidtestAttribute(org.w3c.dom.Attr attribute)Template delegator for testNode() method.voidtestCDATASection(org.w3c.dom.CDATASection cdata)Template delegator for testNode() method.voidtestComment(org.w3c.dom.Comment comment)Template delegator for testNode() method.voidtestDocumentType(org.w3c.dom.DocumentType doctype)Template delegator for testNode() method.voidtestElement(org.w3c.dom.Element element)Template delegator for testNode() method.voidtestEntity(org.w3c.dom.Entity entity)Template delegator for testNode() method.voidtestEntityReference(org.w3c.dom.EntityReference reference)Template delegator for testNode() method.voidtestNode(org.w3c.dom.Node aNode, NodeTest forTest)Validate a single Node by delegating to node type specific methods.voidtestNotation(org.w3c.dom.Notation notation)Template delegator for testNode() method.voidtestProcessingInstruction(org.w3c.dom.ProcessingInstruction instr)Template delegator for testNode() method.voidtestText(org.w3c.dom.Text text)Template delegator for testNode() method.private voidunhandled(org.w3c.dom.Node aNode)
-
-
-
Method Detail
-
testNode
public void testNode(org.w3c.dom.Node aNode, NodeTest forTest) throws NodeTestExceptionValidate a single Node by delegating to node type specific methods.- Specified by:
testNodein interfaceNodeTester- Throws:
NodeTestException- if the node fails the test- See Also:
testAttribute(Attr),testCDATASection(CDATASection),testComment(Comment),testDocumentType(DocumentType),testElement(Element),testEntity(Entity),testEntityReference(EntityReference),testNotation(Notation),testProcessingInstruction(ProcessingInstruction),testText(Text)
-
testAttribute
public void testAttribute(org.w3c.dom.Attr attribute) throws NodeTestExceptionTemplate delegator for testNode() method. OVERRIDE to add custom logic- Parameters:
attribute-- Throws:
NodeTestException- always: override if required in subclass
-
testCDATASection
public void testCDATASection(org.w3c.dom.CDATASection cdata) throws NodeTestExceptionTemplate delegator for testNode() method. OVERRIDE to add custom logic- Parameters:
cdata-- Throws:
NodeTestException- always: override if required in subclass
-
testComment
public void testComment(org.w3c.dom.Comment comment) throws NodeTestExceptionTemplate delegator for testNode() method. OVERRIDE to add custom logic- Parameters:
comment-- Throws:
NodeTestException- always: override if required in subclass
-
testDocumentType
public void testDocumentType(org.w3c.dom.DocumentType doctype) throws NodeTestExceptionTemplate delegator for testNode() method. OVERRIDE to add custom logic- Parameters:
doctype-- Throws:
NodeTestException- always: override if required in subclass
-
testElement
public void testElement(org.w3c.dom.Element element) throws NodeTestExceptionTemplate delegator for testNode() method. OVERRIDE to add custom logic- Parameters:
element-- Throws:
NodeTestException- always: override if required in subclass
-
testEntity
public void testEntity(org.w3c.dom.Entity entity) throws NodeTestExceptionTemplate delegator for testNode() method. OVERRIDE to add custom logic- Parameters:
entity-- Throws:
NodeTestException- always: override if required in subclass
-
testEntityReference
public void testEntityReference(org.w3c.dom.EntityReference reference) throws NodeTestExceptionTemplate delegator for testNode() method. OVERRIDE to add custom logic- Parameters:
reference-- Throws:
NodeTestException- always: override if required in subclass
-
testNotation
public void testNotation(org.w3c.dom.Notation notation) throws NodeTestExceptionTemplate delegator for testNode() method. OVERRIDE to add custom logic- Parameters:
notation-- Throws:
NodeTestException- always: override if required in subclass
-
testProcessingInstruction
public void testProcessingInstruction(org.w3c.dom.ProcessingInstruction instr) throws NodeTestExceptionTemplate delegator for testNode() method. OVERRIDE to add custom logic- Parameters:
instr-- Throws:
NodeTestException- always: override if required in subclass
-
testText
public void testText(org.w3c.dom.Text text) throws NodeTestExceptionTemplate delegator for testNode() method. OVERRIDE to add custom logic- Parameters:
text-- Throws:
NodeTestException- always: override if required in subclass
-
unhandled
private void unhandled(org.w3c.dom.Node aNode) throws NodeTestException- Throws:
NodeTestException
-
noMoreNodes
public void noMoreNodes(NodeTest forTest) throws NodeTestException
Validate that the Nodes validated one-by-one in theisValidmethod were all the Nodes expected. By default do nothing: can override to add custom logic- Specified by:
noMoreNodesin interfaceNodeTester- Throws:
NodeTestException- if mode Nodes were expected
-
-