// Add required features to the manifest
// <require feature="someFeature" />
for (JClassType currentClass = type; currentClass != null; currentClass = currentClass.getSuperclass()) {
for (JClassType interfaceType : currentClass.getImplementedInterfaces()) {
FeatureName name = interfaceType.getAnnotation(FeatureName.class);
if (name != null) {
for (String feature : name.value()) {
// Skip features defined to be implicitly available in the container
if (FeatureName.INTRINSIC.equals(feature)) {
continue;
}
Element require = (Element) modulePrefs.appendChild(d.createElement("Require"));
require.setAttribute("feature", feature);
}
GadgetUtils.writeRequirementsToElement(logger, d, modulePrefs,
name.requirements());
}
}
}
// Generate and append the Content section(s).