String key = element.getAttributeValue("key");
if (StringUtils.isEmpty(key)) {
throw new IllegalArgumentException("No 'key' parameter was passed to find enumeration values");
}
DataDrivenEnumeration ddEnum = enumService.findEnumByKey(key);
if (ddEnum == null) {
throw new IllegalArgumentException("Could not find a data driven enumeration keyed by " + key);
}
List<DataDrivenEnumerationValue> enumValues = new ArrayList<DataDrivenEnumerationValue>(ddEnum.getEnumValues());
final String sort = element.getAttributeValue("sort");
if (StringUtils.isNotEmpty(sort)) {
Collections.sort(enumValues, new Comparator<DataDrivenEnumerationValue>() {