public class CompositeIndex extends java.lang.Object implements IndexView
Index
instances.
An example application is a Java EE deployment, which can contain multiple nested jars, each with
their own index.Modifier and Type | Field and Description |
---|---|
(package private) java.util.Collection<IndexView> |
indexes |
Modifier | Constructor and Description |
---|---|
private |
CompositeIndex(java.util.Collection<IndexView> indexes) |
Modifier and Type | Method and Description |
---|---|
static CompositeIndex |
create(java.util.Collection<IndexView> indexes) |
static CompositeIndex |
create(IndexView... indexes) |
static CompositeIndex |
createMerged(CompositeIndex... indexes) |
java.util.Set<ClassInfo> |
getAllKnownImplementors(DotName interfaceName)
Returns all known classes that implement the given interface, directly and indirectly.
|
java.util.Set<ClassInfo> |
getAllKnownSubclasses(DotName className)
Returns all known (including non-direct) sub classes of the given class.
|
private void |
getAllKnownSubClasses(DotName className,
java.util.Set<ClassInfo> allKnown,
java.util.Set<DotName> processedClasses) |
private void |
getAllKnownSubClasses(DotName name,
java.util.Set<ClassInfo> allKnown,
java.util.Set<DotName> subClassesToProcess,
java.util.Set<DotName> processedClasses) |
java.util.List<AnnotationInstance> |
getAnnotations(DotName annotationName)
Obtains a list of instances for the specified annotation.
|
ClassInfo |
getClassByName(DotName className)
Gets the class (or interface, or annotation) that was scanned during the
indexing phase.
|
java.util.Collection<ClassInfo> |
getKnownClasses()
Gets all known classes by this index (those which were scanned).
|
java.util.Collection<ClassInfo> |
getKnownDirectImplementors(DotName className)
Gets all known direct implementors of the specified interface name.
|
java.util.Set<ClassInfo> |
getKnownDirectSubclasses(DotName className)
Gets all known direct subclasses of the specified class name.
|
private void |
getKnownImplementors(DotName name,
java.util.Set<ClassInfo> allKnown,
java.util.Set<DotName> subInterfacesToProcess,
java.util.Set<DotName> processedClasses) |
final java.util.Collection<IndexView> indexes
private CompositeIndex(java.util.Collection<IndexView> indexes)
public static CompositeIndex create(java.util.Collection<IndexView> indexes)
public static CompositeIndex create(IndexView... indexes)
public static CompositeIndex createMerged(CompositeIndex... indexes)
public java.util.List<AnnotationInstance> getAnnotations(DotName annotationName)
getAnnotations
in interface IndexView
annotationName
- the name of the annotation to look forpublic java.util.Set<ClassInfo> getKnownDirectSubclasses(DotName className)
Note that this will only pick up direct subclasses of the class. It will not pick up subclasses of subclasses.
getKnownDirectSubclasses
in interface IndexView
className
- the super class of the desired subclassespublic java.util.Set<ClassInfo> getAllKnownSubclasses(DotName className)
getAllKnownSubclasses
in interface IndexView
className
- The classprivate void getAllKnownSubClasses(DotName className, java.util.Set<ClassInfo> allKnown, java.util.Set<DotName> processedClasses)
private void getAllKnownSubClasses(DotName name, java.util.Set<ClassInfo> allKnown, java.util.Set<DotName> subClassesToProcess, java.util.Set<DotName> processedClasses)
public java.util.Collection<ClassInfo> getKnownDirectImplementors(DotName className)
The list of implementors may also include other methodParameters, in order to get a complete
list of all classes that are assignable to a given interface it is necessary to
recursively call IndexView.getKnownDirectImplementors(DotName)
for every implementing
interface found.
getKnownDirectImplementors
in interface IndexView
className
- the super class of the desired subclassespublic java.util.Set<ClassInfo> getAllKnownImplementors(DotName interfaceName)
This will only return classes, not methodParameters.
getAllKnownImplementors
in interface IndexView
interfaceName
- The interfaceprivate void getKnownImplementors(DotName name, java.util.Set<ClassInfo> allKnown, java.util.Set<DotName> subInterfacesToProcess, java.util.Set<DotName> processedClasses)
public ClassInfo getClassByName(DotName className)
getClassByName
in interface IndexView
className
- the name of the classpublic java.util.Collection<ClassInfo> getKnownClasses()
getKnownClasses
in interface IndexView