Hi,
I noticed that the current code injection plugin doesn't allow to
inject code into enums. This is due to the plugin only iterating over
getClasses() and not getEnums(). A very simple addition would add
support for code injection in enums:
for (EnumOutline eo : model.getEnums()) {
CPluginCustomization c =
eo.target.getCustomizations().find(Const.NS, "code");
if (c == null) {
continue; // no customization --- nothing to inject
here
}
c.markAsAcknowledged();
// TODO: ideally you should validate this DOM element to
make sure
// that there's no typo/etc. JAXP 1.3 can do this very
easily.
String codeFragment = DOMUtils.getElementText(c.element);
// inject the specified code fragment into the
implementation class.
eo.clazz.direct(codeFragment);
}
Please let me know if there is proper way to propose code changes.
Regards,
Karsten