use of org.whole.lang.matchers.MatchException in project whole by wholeplatform.
the class TestsHelpers method updateFilterBody.
public static IEntity updateFilterBody(IEntity pattern, IEntity model, Sequence sequence) {
IBindingManager bindings = BindingManagerFactory.instance.createBindingManager();
boolean match = false;
while (!match) {
try {
bindings.wEnterScope();
// try to match
new GenericMatcher().withBindings(bindings).match(applyFilter(sequence, EntityUtils.clone(pattern), bindings), applyFilter(sequence, EntityUtils.clone(model), bindings));
// eventually matches
match = true;
} catch (MatchException e) {
// update normalization
sequence.wAdd(QueriesEntityFactory.instance.createDelete(QueriesUtils.createRootPath(e.pattern)));
} finally {
// clear scope
bindings.wExitScope();
}
}
return sequence;
}
Aggregations