/**
* Always returns a singleton set containing only "*".
*
* This method returns the argument to the {@link
* SupportedAnnotationTypes} annotation, so the effect of returning "*"
* is as if the checker were annotated by
* {@code @SupportedAnnotationTypes("*")}:
* javac runs the checker on every
* class mentioned on the javac command line. This method also checks
* that subclasses do not contain a {@link SupportedAnnotationTypes}
* annotation. <p>
*
* To specify the annotations that a checker recognizes as type qualifiers,
* use the {@link TypeQualifiers} annotation on the declaration of
* subclasses of this class or override the
* {@link BaseAnnotatedTypeFactory#getSupportedTypeQualifiers()} method.
*
* @throws Error if a subclass is annotated with
* {@link SupportedAnnotationTypes}
*
* @see TypeQualifiers
*/
@Override
public final Set<String> getSupportedAnnotationTypes() {
SupportedAnnotationTypes supported = this.getClass().getAnnotation(
SupportedAnnotationTypes.class);
if (supported != null)
ErrorReporter.errorAbort("@SupportedAnnotationTypes should not be written on any checker;"
+ " supported annotation types are inherited from SourceChecker.");
return Collections.singleton("*");
}
java类javax.annotation.processing.SupportedAnnotationTypes的实例源码
SourceChecker.java 文件源码
项目:checker-framework
阅读 25
收藏 0
点赞 0
评论 0