Methods Summary |
---|
private static java.util.Set | arrayToSet(java.lang.String[] array)
assert array != null;
Set<String> set = new HashSet<String>(array.length);
for (String s : array)
set.add(s);
return Collections.unmodifiableSet(set);
|
public java.lang.Iterable | getCompletions(javax.lang.model.element.Element element, javax.lang.model.element.AnnotationMirror annotation, javax.lang.model.element.ExecutableElement member, java.lang.String userText)Returns an empty iterable of completions.
return Collections.emptyList();
|
public java.util.Set | getSupportedAnnotationTypes()If the processor class is annotated with {@link
SupportedAnnotationTypes}, return an unmodifiable set with the
same set of strings as the annotation. If the class is not so
annotated, an empty set is returned.
SupportedAnnotationTypes sat = this.getClass().getAnnotation(SupportedAnnotationTypes.class);
if (sat == null) {
if (isInitialized())
processingEnv.getMessager().printMessage(Diagnostic.Kind.WARNING,
"No SupportedAnnotationTypes annotation " +
"found on " + this.getClass().getName() +
", returning an empty set.");
return Collections.emptySet();
}
else
return arrayToSet(sat.value());
|
public java.util.Set | getSupportedOptions()If the processor class is annotated with {@link
SupportedOptions}, return an unmodifiable set with the same set
of strings as the annotation. If the class is not so
annotated, an empty set is returned.
SupportedOptions so = this.getClass().getAnnotation(SupportedOptions.class);
if (so == null)
return Collections.emptySet();
else
return arrayToSet(so.value());
|
public javax.lang.model.SourceVersion | getSupportedSourceVersion()If the processor class is annotated with {@link
SupportedSourceVersion}, return the source version in the
annotation. If the class is not so annotated, {@link
SourceVersion#RELEASE_6} is returned.
SupportedSourceVersion ssv = this.getClass().getAnnotation(SupportedSourceVersion.class);
SourceVersion sv = null;
if (ssv == null) {
sv = SourceVersion.RELEASE_6;
if (isInitialized())
processingEnv.getMessager().printMessage(Diagnostic.Kind.WARNING,
"No SupportedSourceVersion annotation " +
"found on " + this.getClass().getName() +
", returning " + sv + ".");
} else
sv = ssv.value();
return sv;
|
public synchronized void | init(javax.annotation.processing.ProcessingEnvironment processingEnv)Initializes the processor with the processing environment by
setting the {@code processingEnv} field to the value of the
{@code processingEnv} argument. An {@code
IllegalStateException} will be thrown if this method is called
more than once on the same object.
if (initialized)
throw new IllegalStateException("Cannot call init more than once.");
if (processingEnv == null)
throw new NullPointerException("Tool provided null ProcessingEnvironment");
this.processingEnv = processingEnv;
initialized = true;
|
protected synchronized boolean | isInitialized()Returns {@code true} if this object has been {@linkplain #init
initialized}, {@code false} otherwise.
return initialized;
|
public abstract boolean | process(java.util.Set annotations, javax.annotation.processing.RoundEnvironment roundEnv){@inheritDoc}
|