本文整理匯總了Java中javax.annotation.processing.SupportedAnnotationTypes類的典型用法代碼示例。如果您正苦於以下問題:Java SupportedAnnotationTypes類的具體用法?Java SupportedAnnotationTypes怎麽用?Java SupportedAnnotationTypes使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
SupportedAnnotationTypes類屬於javax.annotation.processing包,在下文中一共展示了SupportedAnnotationTypes類的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getSupportedAnnotationTypes
import javax.annotation.processing.SupportedAnnotationTypes; //導入依賴的package包/類
/**
* 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("*");
}