net.sf.xmlmatcher
Interface MatcherListener

All Known Implementing Classes:
ChaingedMatcherListener, CountingMatcherListener, EquivalenceChecker

public interface MatcherListener

Listener interface that is aware of any matches/mismatched happened during parsing. May be used for logging, interactive debuggers, or plug-ins like assertion checker. NOTE: Each template element may be mapped to [0..n] actual elements (0 may correspond to unselected alternative of xr:choice, n may correspond to template symbols with 'unbound' multiplicity). Each actual element may have 0..1 template elements (0 may correspond to children of element mapped with xr:any).

See Also:
for usage example

Method Summary
 void afterMatch(org.w3c.dom.Element template, org.w3c.dom.Element actual)
          Called after matcher successfully matched two elements
 void afterMismatch(org.w3c.dom.Element template, org.w3c.dom.Element actual)
          Called by matcher when two elements do not match, right before MatcherException is thrown
 void beforeMatch(org.w3c.dom.Element template, org.w3c.dom.Element actual)
          Called before matcher starts matching two elements
 

Method Detail

beforeMatch

void beforeMatch(org.w3c.dom.Element template,
                 org.w3c.dom.Element actual)
                 throws MatcherException
Called before matcher starts matching two elements

Throws:
MatcherException - callback may throw this exception to signal mismatch right away

afterMatch

void afterMatch(org.w3c.dom.Element template,
                org.w3c.dom.Element actual)
                throws MatcherException
Called after matcher successfully matched two elements

Throws:
MatcherException - callback may throw this exception to override successful match

afterMismatch

void afterMismatch(org.w3c.dom.Element template,
                   org.w3c.dom.Element actual)
Called by matcher when two elements do not match, right before MatcherException is thrown



Copyright © 2007. All Rights Reserved.