Integer retValue = null;
for (Annotation annotation : annotations) {
if (PodamIntValue.class.isAssignableFrom(annotation.getClass())) {
PodamIntValue intStrategy = (PodamIntValue) annotation;
String numValueStr = intStrategy.numValue();
if (null != numValueStr && !"".equals(numValueStr)) {
try {
retValue = Integer.valueOf(numValueStr);
} catch (NumberFormatException nfe) {
String errMsg = THE_ANNOTATION_VALUE_STR
+ numValueStr
+ " could not be converted to an Integer. An exception will be thrown.";
LOG.error(errMsg);
throw new IllegalArgumentException(errMsg, nfe);
}
} else {
int minValue = intStrategy.minValue();
int maxValue = intStrategy.maxValue();
// Sanity check
if (minValue > maxValue) {
maxValue = minValue;
}