com.softicar.platform.common.ui.wiki.token.matcher.WikiTokenMatcherList Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of platform-common Show documentation
Show all versions of platform-common Show documentation
The SoftiCAR Platform is a lightweight, Java-based library to create interactive business web applications.
package com.softicar.platform.common.ui.wiki.token.matcher;
import com.softicar.platform.common.ui.wiki.tokenizer.IWikiTokenizer;
import java.util.ArrayList;
public class WikiTokenMatcherList implements IWikiTokenMatcher {
private final ArrayList matchers;
public WikiTokenMatcherList() {
this.matchers = new ArrayList<>();
}
public WikiTokenMatcherList addMatcher(IWikiTokenMatcher matcher) {
matchers.add(matcher);
return this;
}
@Override
public boolean match(IWikiTokenizer tokenizer) {
for (IWikiTokenMatcher matcher: matchers) {
if (matcher.match(tokenizer)) {
return true;
}
}
return false;
}
}