String _source = (String)parameters.get("source");
ErrorBuffer errorBuffer = new ErrorBuffer();
if (_source == null) {
errorBuffer.add(Widget.class.getSimpleName(), new EmptyPropertyToken(source));
} else {
// check source for mandatory parameters
Matcher matcher = threadLocalTemplateMatcher.get();
// initialize with source
matcher.reset(_source);
while (matcher.find()) {
String group = matcher.group();
String source = group.substring(1, group.length() - 1);
ReplacementInfo info = new ReplacementInfo(source);
ArrayList<String> options = info.getOptions();
String key = info.getKey();
Object value = parameters.get(key);
if (value == null) {
if (!options.isEmpty()) {
errorBuffer.add(Widget.class.getSimpleName(), new ValueToken(new StringProperty(key), options.toArray()));
} else {
errorBuffer.add(Widget.class.getSimpleName(), new EmptyPropertyToken(new StringProperty(key)));
}
} else {
// replace and restart matching process