I think you misunderstand what sourceType.hasAnnotation(…)
actually returns. As the name suggests, it inspects the type for annotations. So for a given type like this:
@MyAnnotation
class Foo { }
it would allow you to find @MyAnnotation
. However you are writing about "annotated strings". I assume you mean something like:
class Bar {
@MyAnnotation
String property;
}
This is not a type annotation and the Converter
API is not meant to cover such cases. If you think supporting such scenarios would be worthfile, please file a JIRA ticket.