Commit 5964bc4f authored by Björn Richerzhagen's avatar Björn Richerzhagen
Browse files

Allowed IfEqualStr-Tags as first-level elements

parent f9c0399c
......@@ -296,10 +296,31 @@ public class DefaultConfigurator implements Configurator {
* @return configured component
*/
public Object configureComponent(Element elem) {
String name = elem.getName();
if (Configurator.SPECIAL_IF_EQUAL_STR.equalsIgnoreCase(name)) {
processIfEqualStr(elem, new ToConfigureCallback() {
@Override
public void run(Element elemToConfigure) {
configureComponent(elemToConfigure);
}
});
return null;
}
if (Configurator.SPECIAL_IF_NOT_EQUAL_STR.equalsIgnoreCase(name)) {
processIfNotEqualStr(elem, new ToConfigureCallback() {
@Override
public void run(Element elemToConfigure) {
configureComponent(elemToConfigure);
}
});
return null;
}
Monitor.log(DefaultConfigurator.class, Level.DEBUG,
"Configure component " + elem.getName());
Object component = configurables.get(elem.getName());
"Configure component " + name);
Object component = configurables.get(name);
// register new component (if not done yet)
Set<String> consAttrs = new HashSet<String>(); // attributes that were
// part of the
......@@ -313,7 +334,7 @@ public class DefaultConfigurator implements Configurator {
Monitor.log(DefaultConfigurator.class, Level.INFO,
"Configure component "
+ component.getClass().getSimpleName() + " with element "
+ elem.getName());
+ name);
configureAttributes(component, elem, consAttrs);
// configure subcomponents
if (component instanceof Builder) {
......@@ -332,7 +353,7 @@ public class DefaultConfigurator implements Configurator {
} else {
// component cannot be created and has not been registered
Monitor.log(DefaultConfigurator.class, Level.WARN, "Skip element "
+ elem.getName());
+ name);
}
return component;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment