EventCartridge eventCartridge = new EventCartridge();
eventCartridge.addEventHandler(new PropertiesReferenceInsertionHandler(currentGenerate.getConfigDescriptor(),
props));
Context context = new AbstractContext() {
@Override
public Object internalRemove(Object key) {
return descriptorProps.remove(key);
}
@Override
public Object internalPut(String key, Object value) {
return descriptorProps.put(key, value);
}
@Override
public Object[] internalGetKeys() {
Set<Object> keys = new LinkedHashSet<Object>(props.keySet());
keys.addAll(descriptorProps.keySet());
return keys.toArray(new Object[keys.size()]);
}
@Override
public Object internalGet(String key) {
if (descriptorProps.containsKey(key)) {
return descriptorProps.get(key);
} else {
return PropertiesLoader.evaluate(key, props);
}
}
@Override
public boolean internalContainsKey(Object key) {
return descriptorProps.containsKey(key) || props.containsKey(key);
}
};
eventCartridge.attachToContext(context); // ����ʹ��${a.b.c}
context.put("D", "$"); // ������${D}������$
return context;
}