net.sf.xmlmatcher.strategy
Class TextValueMatchingStrategy

java.lang.Object
  extended by net.sf.xmlmatcher.strategy.TextValueMatchingStrategy
All Implemented Interfaces:
MatchingStrategy
Direct Known Subclasses:
EqualTextValueMatchingStrategy, FloatingNumbersMatchingStrategy, RegExTextMatchingStrategy, TimeOfDayMatchingStrategy, WildcardMatchingStrategy

public abstract class TextValueMatchingStrategy
extends java.lang.Object
implements MatchingStrategy

Base class for all strategies that compare text values of elements


Field Summary
static java.lang.String TRIM_ATTR
           
 
Constructor Summary
protected TextValueMatchingStrategy()
           
 
Method Summary
 void matchContent(org.w3c.dom.Element template, org.w3c.dom.Element actual, Matcher matcher)
           
protected abstract  void matchTextContent(org.w3c.dom.Element template, org.w3c.dom.Element actual, java.lang.String templateValue, java.lang.String actualValue, Matcher matcher)
           
protected  InvalidTemplateException newBadTemplateException(TextValueMatchingStrategy strategy, org.w3c.dom.Element template)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface net.sf.xmlmatcher.MatchingStrategy
select
 

Field Detail

TRIM_ATTR

public static final java.lang.String TRIM_ATTR
See Also:
Constant Field Values
Constructor Detail

TextValueMatchingStrategy

protected TextValueMatchingStrategy()
Method Detail

matchContent

public final void matchContent(org.w3c.dom.Element template,
                               org.w3c.dom.Element actual,
                               Matcher matcher)
                        throws XMLMismatchException,
                               InvalidTemplateException
Specified by:
matchContent in interface MatchingStrategy
Parameters:
template - Element
actual - Element
matcher - Matcher (allows to match deeper levels)
Throws:
XMLMismatchException
InvalidTemplateException

matchTextContent

protected abstract void matchTextContent(org.w3c.dom.Element template,
                                         org.w3c.dom.Element actual,
                                         java.lang.String templateValue,
                                         java.lang.String actualValue,
                                         Matcher matcher)
                                  throws XMLMismatchException,
                                         InvalidTemplateException
Parameters:
templateValue - non-nullable String
actualValue - non-nullable String
Throws:
XMLMismatchException
InvalidTemplateException

newBadTemplateException

protected InvalidTemplateException newBadTemplateException(TextValueMatchingStrategy strategy,
                                                           org.w3c.dom.Element template)
                                                    throws InvalidTemplateException
Throws:
InvalidTemplateException


Copyright © 2007. All Rights Reserved.