String linkAttrsValue = conf.getChild("link-attrs").getValue("");
this.origLinkAttrs = split(linkAttrsValue, " ", NO_REGEXP);
Configuration[] attrConfs = conf.getChildren("link-attr");
if (attrConfs.length > 0) {
RECompiler compiler = new RECompiler();
for (int i = 0; i < attrConfs.length; i++) {
String attr = attrConfs[i].getAttribute("name");
if (getLogger().isWarnEnabled() && origLinkAttrs.containsKey(attr)) {
getLogger().warn("Duplicate configuration entry found for attribute '" +
attr + "', overwriting previous configuration");
}
String pattern = attrConfs[i].getAttribute("pattern", null);
if (pattern == null) {
this.origLinkAttrs.put(attr, NO_REGEXP);
} else {
try {
this.origLinkAttrs.put(attr, compiler.compile(pattern));
} catch (RESyntaxException e) {
String msg = "Invalid regexp pattern '" + pattern + "' specified for attribute '" + attr + "'";
throw new ConfigurationException(msg, attrConfs[i], e);
}
}