net.sf.xmlmatcher.strategy
Class WildcardMatchingStrategy

java.lang.Object
  extended by net.sf.xmlmatcher.strategy.TextValueMatchingStrategy
      extended by net.sf.xmlmatcher.strategy.WildcardMatchingStrategy
All Implemented Interfaces:
MatchingStrategy

public final class WildcardMatchingStrategy
extends TextValueMatchingStrategy

Compares text value in actual element with wildcard-based pattern defined in template. This class uses WildcardMatcher, so at the moment of writing only '*' wildcard is supported.


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

Constructor Detail

WildcardMatchingStrategy

public WildcardMatchingStrategy()
Method Detail

select

public boolean select(org.w3c.dom.Element template,
                      boolean hasChildren)
Parameters:
template - template Element to compare
hasChildren - true if given template element has children elements
Returns:
true if this strategy can handle comparison of given template to some actual element

matchTextContent

protected void matchTextContent(org.w3c.dom.Element template,
                                org.w3c.dom.Element actual,
                                java.lang.String patternValue,
                                java.lang.String actualValue,
                                Matcher matcher)
                         throws XMLMismatchException
Specified by:
matchTextContent in class TextValueMatchingStrategy
patternValue - non-nullable String
actualValue - non-nullable String
Throws:
XMLMismatchException


Copyright © 2007. All Rights Reserved.