String rawValueString = rawAnnotationString.substring(annotationName.length());
rawValueString = rawValueString.trim();
char first = rawValueString.charAt(0);
if (first == '(') {
if (!rawValueString.endsWith(")")) {
throw new CompilerException("annotation not well-formed, needs to end with a closing parenthesis ["
+ rawAnnotationString + "]",
SourceLocation.render(annotationClass, tag, enclosingClassName, enclosingClassFileName)
);
}
return new RawAnnotation(annotationClass, rawValueString.substring(1, rawValueString.length()-1), tag.getLineNumber(), enclosingClassName, enclosingClassFileName);
} else if (first == '"') {
if (!rawValueString.endsWith("\"")) {
throw new CompilerException("annotation not well-formed, needs to end with a closing \" ["
+ rawAnnotationString + "]",
SourceLocation.render(annotationClass, tag, enclosingClassName, enclosingClassFileName)
);
}
return new RawAnnotation(annotationClass, rawValueString, tag.getLineNumber(), enclosingClassName, enclosingClassFileName);