net.sf.xmlmatcher.strategy
Class RegExElementsMatchingStrategy
java.lang.Object
net.sf.xmlmatcher.strategy.RegExElementsMatchingStrategy
- All Implemented Interfaces:
- MatchingStrategy
public final class RegExElementsMatchingStrategy
- extends java.lang.Object
- implements MatchingStrategy
Compares set of child elements in template with set of actual elements using regex-like syntax.
Template document defines pattern (using normal elements, and special
contructs like xr:choice, xr:group, xr:any, etc).
See package td.util.xml.comp.rex for more information.
Method Summary |
void |
matchContent(org.w3c.dom.Element template,
org.w3c.dom.Element actual,
Matcher matcher)
|
boolean |
select(org.w3c.dom.Element template,
boolean hasChildren)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
RegExElementsMatchingStrategy
public RegExElementsMatchingStrategy()
select
public boolean select(org.w3c.dom.Element template,
boolean hasChildren)
- Specified by:
select
in interface MatchingStrategy
- Parameters:
template
- template Element to comparehasChildren
- true if given template element has children elements
- Returns:
- true if this strategy can handle comparison of given template to some actual element
matchContent
public 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
- Elementactual
- Elementmatcher
- Matcher (allows to match deeper levels)
- Throws:
XMLMismatchException
InvalidTemplateException
Copyright © 2007. All Rights Reserved.