public class Index<A extends Annotation> extends Object implements Iterable<IndexItem<A>>
You would call it like this:
for (IndexItem<MyAnnotation> item : Index.load(MyAnnotation.class)) { // do something with item.annotation() and/or item.className() }
Modifier and Type | Method and Description |
---|---|
Iterator<IndexItem<A>> |
iterator() |
static <A extends Annotation> |
load(Class<A> annotation)
Loads the index of all classes annotated with the specified annotation.
|
static <A extends Annotation> |
load(Class<A> annotation,
ClassLoader loader)
Loads the index of all classes annotated with the specified annotation.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEach, spliterator
public static <A extends Annotation> Index<A> load(Class<A> annotation)
The specified annotation needs to be annotated with Indexable
for
the annotation indexing to work properly, of course.
annotation
- the annotation typepublic static <A extends Annotation> Index<A> load(Class<A> annotation, ClassLoader loader)
annotation
- the annotation typeloader
- the class loader to use when loading Class
-type
annotation fieldsCopyright © 2015–2022 SciJava. All rights reserved.