Modifier and Type | Method | Description |
---|---|---|
Iterator<IndexItem<A,I>> |
iterator() |
Find all items in the index.
|
static <A extends Annotation,I> |
load(Class<A> annotation,
Class<I> instanceType) |
Load an index for a given annotation type.
|
static <A extends Annotation,I> |
load(Class<A> annotation,
Class<I> instanceType,
ClassLoader loader) |
Load an index for a given annotation type.
|
forEach, spliterator
public static <A extends Annotation,I> Index<A,I> load(Class<A> annotation, Class<I> instanceType) throws IllegalArgumentException
annotation
- the type of annotation to findinstanceType
- the type of instance to be created (use Void
if all instances will be null)IllegalArgumentException
- if the annotation type is not marked with Indexable
or the instance type is not equal to or a supertype of the annotation's actual Indexable.type()
public static <A extends Annotation,I> Index<A,I> load(Class<A> annotation, Class<I> instanceType, ClassLoader loader) throws IllegalArgumentException
annotation
- the type of annotation to findinstanceType
- the type of instance to be created (use Void
if all instances will be null)loader
- a class loader in which to find the index and any annotated classesIllegalArgumentException
- if the annotation type is not marked with Indexable
or the instance type is not equal to or a supertype of the annotation's actual Indexable.type()
public Iterator<IndexItem<A,I>> iterator()
IndexError
as the index is parsed lazily.iterator
in interface Iterable<A extends Annotation>
Copyright © 2018. All rights reserved.