private static CannedGroupAddition parseCGAdditions(CannedGroupExpressions descriptor, String plugin) {
if (descriptor == null) {
return null;
}
CannedGroupAddition addition = new CannedGroupAddition();
for (CannedGroupExpressions.Definition def : descriptor.getGroupDefinitions()) {
CannedGroupExpression cge = new CannedGroupExpression();
cge.setId(def.getId());
cge.setName(def.getName());
cge.setPlugin(plugin);
cge.setCreateByDefault(def.isCreateByDefault());
cge.setDescription(def.getDescription());
cge.setExpression(def.getExpression());
cge.setRecalcInMinutes(def.getRecalcInMinutes().intValue());
if (validateCGE(cge)) {
addition.getExpressions().add(cge);
}
}
return addition;
}