1
私はIAnnotation
インスタンスを持っています。IAnnotation#getElementName()
が単純な名前を返す場合、注釈の完全修飾型名を取得するにはどうすればよいですか?JDT ASTを使用して注釈のタイプを取得する方法は?
IAnnotation ruleAnnotation = field.getAnnotation("Rule");
String fullQualifiedName = ???
if (fullQualifiedName.equals("org.junit.Rule")){
...
}
私はこの答えを見つけましたが、これは異なるユースケースである: How to determine if a class has an annotation using JDT, considering the type hierarchy