if (!(value instanceof AnnotationEnum)) {
logger.log(TreeLogger.ERROR,
"Annotation error: expected an enum value," + " but got " + value);
return null;
}
AnnotationEnum annotEnum = (AnnotationEnum) value;
Class<? extends Enum> enumType = expectedType.asSubclass(Enum.class);
try {
return Enum.valueOf(enumType, annotEnum.getValue());
} catch (IllegalArgumentException e) {
logger.log(TreeLogger.WARN, "Unable to resolve annotation value '"
+ annotEnum.getValue() + "' within enum type '"
+ enumType.getName() + "'");
return null;
}
} else if (Annotation.class.isAssignableFrom(expectedType)) {
if (!(value instanceof AnnotationData)) {