private ClassNode getTargetClass(SourceUnit source, AnnotationNode annotation) {
final Expression value = annotation.getMember("value");
if (value == null || !(value instanceof ClassExpression)) {
//noinspection ThrowableInstanceNeverThrown
source.getErrorCollector().addErrorAndContinue(
new SyntaxErrorMessage(new SyntaxException(
"@groovy.lang.Category must define 'value' which is the class to apply this category to",
annotation.getLineNumber(),
annotation.getColumnNumber()),
source));
}