Package org.custommonkey.xmlunit
Class AbstractNodeTester
- java.lang.Object
-
- org.custommonkey.xmlunit.AbstractNodeTester
-
- All Implemented Interfaces:
NodeTester
public abstract class AbstractNodeTester extends 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(Attr attribute)Template delegator for testNode() method.voidtestCDATASection(CDATASection cdata)Template delegator for testNode() method.voidtestComment(Comment comment)Template delegator for testNode() method.voidtestDocumentType(DocumentType doctype)Template delegator for testNode() method.voidtestElement(Element element)Template delegator for testNode() method.voidtestEntity(Entity entity)Template delegator for testNode() method.voidtestEntityReference(EntityReference reference)Template delegator for testNode() method.voidtestNode(Node aNode, NodeTest forTest)Validate a single Node by delegating to node type specific methods.voidtestNotation(Notation notation)Template delegator for testNode() method.voidtestProcessingInstruction(ProcessingInstruction instr)Template delegator for testNode() method.voidtestText(Text text)Template delegator for testNode() method.
-
-
-
Method Detail
-
testNode
public void testNode(Node aNode, NodeTest forTest) throws NodeTestException
Validate a single Node by delegating to node type specific methods.- Specified by:
testNodein interfaceNodeTester- Parameters:
aNode- the node to testforTest- the test to perform- 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(Attr attribute) throws NodeTestException
Template delegator for testNode() method. OVERRIDE to add custom logic- Parameters:
attribute- the attribute to test- Throws:
NodeTestException- always: override if required in subclass
-
testCDATASection
public void testCDATASection(CDATASection cdata) throws NodeTestException
Template delegator for testNode() method. OVERRIDE to add custom logic- Parameters:
cdata- the CDATA section to test- Throws:
NodeTestException- always: override if required in subclass
-
testComment
public void testComment(Comment comment) throws NodeTestException
Template delegator for testNode() method. OVERRIDE to add custom logic- Parameters:
comment- the comment to test- Throws:
NodeTestException- always: override if required in subclass
-
testDocumentType
public void testDocumentType(DocumentType doctype) throws NodeTestException
Template delegator for testNode() method. OVERRIDE to add custom logic- Parameters:
doctype- the cofument type to test- Throws:
NodeTestException- always: override if required in subclass
-
testElement
public void testElement(Element element) throws NodeTestException
Template delegator for testNode() method. OVERRIDE to add custom logic- Parameters:
element- the element to test- Throws:
NodeTestException- always: override if required in subclass
-
testEntity
public void testEntity(Entity entity) throws NodeTestException
Template delegator for testNode() method. OVERRIDE to add custom logic- Parameters:
entity- the entity to test- Throws:
NodeTestException- always: override if required in subclass
-
testEntityReference
public void testEntityReference(EntityReference reference) throws NodeTestException
Template delegator for testNode() method. OVERRIDE to add custom logic- Parameters:
reference- the reference to test- Throws:
NodeTestException- always: override if required in subclass
-
testNotation
public void testNotation(Notation notation) throws NodeTestException
Template delegator for testNode() method. OVERRIDE to add custom logic- Parameters:
notation- the notation to test- Throws:
NodeTestException- always: override if required in subclass
-
testProcessingInstruction
public void testProcessingInstruction(ProcessingInstruction instr) throws NodeTestException
Template delegator for testNode() method. OVERRIDE to add custom logic- Parameters:
instr- the processing instruction to test- Throws:
NodeTestException- always: override if required in subclass
-
testText
public void testText(Text text) throws NodeTestException
Template delegator for testNode() method. OVERRIDE to add custom logic- Parameters:
text- the text to test- Throws:
NodeTestException- always: override if required in subclass
-
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- Parameters:
forTest- the test to perform- Throws:
NodeTestException- if mode Nodes were expected
-
-