@SuppressWarnings({ "rawtypes", "unchecked" })
@Override
public Object applyValueToMap(Object value, Map target) {
if (value instanceof StructuredModification) {
return ((StructuredModification)value).applyToKeyInMap(this, target);
} else if (value instanceof Collection) {
String warning = "Discouraged undecorated setting of a collection to ListConfigKey "+this+": use ListModification.{set,add}. " +
"Defaulting to 'add'. Look at debug logging for call stack.";
log.warn(warning);
if (log.isDebugEnabled())
log.debug("Trace for: "+warning, new Throwable("Trace for: "+warning));
for (Object v: (Collection)value)
applyValueToMap(v, target);
return null;
} else {
target.put(subKey(), value);
return null;
}
}