net.sf.xmlmatcher.matcher
Class MatcherImpl

java.lang.Object
  extended by net.sf.xmlmatcher.matcher.MatcherImpl
All Implemented Interfaces:
Matcher
Direct Known Subclasses:
AttributesMatcher, JsProcessor, MatcherChain, StrategyBasedMatcher, TagNamesMatcher

public abstract class MatcherImpl
extends java.lang.Object
implements Matcher


Field Summary
 
Fields inherited from interface net.sf.xmlmatcher.Matcher
XML_NAMESPACE_URI
 
Constructor Summary
MatcherImpl()
           
 
Method Summary
 void addListener(MatcherListener listnr)
           
 Matcher getTopLevelMatcher()
          Matchers may be organized into tree using MatcherChain class.
 void match(org.w3c.dom.Element template, org.w3c.dom.Element actual)
          Compare two XML trees specified by given elements.
abstract  void matchElements(org.w3c.dom.Element template, org.w3c.dom.Element actual)
          Compare two XML trees specified by given elements.
 void removeListener(MatcherListener listnr)
           
 void setTopLevelMatcher(Matcher matcher)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MatcherImpl

public MatcherImpl()
Method Detail

getTopLevelMatcher

public Matcher getTopLevelMatcher()
Matchers may be organized into tree using MatcherChain class. When this happens each matcher in the tree stores reference to top-level matcher (usually instance of MatcherChain).

Specified by:
getTopLevelMatcher in interface Matcher

setTopLevelMatcher

public void setTopLevelMatcher(Matcher matcher)
Specified by:
setTopLevelMatcher in interface Matcher
See Also:
getTopLevelMatcher()

addListener

public void addListener(MatcherListener listnr)
Specified by:
addListener in interface Matcher

removeListener

public void removeListener(MatcherListener listnr)
Specified by:
removeListener in interface Matcher

matchElements

public abstract void matchElements(org.w3c.dom.Element template,
                                   org.w3c.dom.Element actual)
                            throws MatcherException
Compare two XML trees specified by given elements. Verifies that template and actual elements have the same tag name and namespace, then invokes most appropriate comparator based on template element.

Parameters:
template - Template Element
actual - Actual Element (instance)
Throws:
MatcherException

match

public final void match(org.w3c.dom.Element template,
                        org.w3c.dom.Element actual)
                 throws MatcherException
Description copied from interface: Matcher
Compare two XML trees specified by given elements. Verifies that template and actual elements have the same tag name and namespace, then invokes most appropriate comparator based on template element.

Specified by:
match in interface Matcher
Parameters:
template - Template Element
actual - Actual Element (instance)
Throws:
MatcherException


Copyright © 2007. All Rights Reserved.