Skip to content

Commit 551f62a

Browse files
committed
AnnotationProcessor: do not warn about Java >8
And improve the javadoc to describe more the purpose of this very general annotation processor.
1 parent afbd606 commit 551f62a

1 file changed

Lines changed: 24 additions & 3 deletions

File tree

src/main/java/org/scijava/annotations/AnnotationProcessor.java

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@
5050
import javax.annotation.processing.Filer;
5151
import javax.annotation.processing.RoundEnvironment;
5252
import javax.annotation.processing.SupportedAnnotationTypes;
53-
import javax.annotation.processing.SupportedSourceVersion;
5453
import javax.lang.model.SourceVersion;
5554
import javax.lang.model.element.AnnotationMirror;
5655
import javax.lang.model.element.AnnotationValue;
@@ -69,16 +68,38 @@
6968
import org.scijava.annotations.AbstractIndexWriter.StreamFactory;
7069

7170
/**
72-
* The annotation processor for use with Java 8 and earlier.
71+
* An annotation processor for indexing {@link Indexable} annotations at
72+
* compile time. The design is inspired by
73+
* <a href="https://github.com/jglick/sezpoz">Sezpoz</a>, a compile-time
74+
* indexing library by Jesse Glick.
75+
* <p>
76+
* For each annotated class, this processor writes a JSON record of the
77+
* annotation's attributes into {@code META-INF/json/} under a file named after
78+
* the annotation type. At runtime, the index can be read to discover annotated
79+
* classes and inspect their annotation values without loading (and therefore
80+
* initializing) those classes — avoiding the cost and side-effects of a full
81+
* classpath scan.
82+
* </p>
83+
* <p>
84+
* For example, SciJava Common's {@link org.scijava.plugin.Plugin} annotation
85+
* enables the {@link org.scijava.Context} application container to discover
86+
* and prepare the application including all its plugins without needing to
87+
* load all of those plugins in advance. Rather, they can be loaded upon first
88+
* use in each appropriate context, greatly reducing application startup cost.
89+
* </p>
7390
*
7491
* @author Johannes Schindelin
7592
*/
76-
@SupportedSourceVersion(SourceVersion.RELEASE_8)
7793
@SupportedAnnotationTypes("*")
7894
public class AnnotationProcessor extends AbstractProcessor {
7995

8096
private RoundEnvironment roundEnv;
8197

98+
@Override
99+
public SourceVersion getSupportedSourceVersion() {
100+
return SourceVersion.latestSupported();
101+
}
102+
82103
@Override
83104
public boolean process(final Set<? extends TypeElement> elements,
84105
final RoundEnvironment env)

0 commit comments

Comments
 (0)