public final class Index extends Object implements IndexView
It contains the following information:
| Modifier and Type | Method and Description |
|---|---|
static Index |
create(Map<DotName,List<AnnotationInstance>> annotations,
Map<DotName,List<ClassInfo>> subclasses,
Map<DotName,List<ClassInfo>> implementors,
Map<DotName,ClassInfo> classes)
Constructs a "mock" Index using the passed values.
|
Set<ClassInfo> |
getAllKnownImplementors(DotName interfaceName)
Returns all known classes that implement the given interface, directly and indirectly.
|
Collection<ClassInfo> |
getAllKnownSubclasses(DotName className)
Returns all known (including non-direct) sub classes of the given class.
|
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.
|
Collection<ClassInfo> |
getKnownClasses()
Gets all known classes by this index (those which were scanned).
|
List<ClassInfo> |
getKnownDirectImplementors(DotName className)
Gets all known direct implementors of the specified interface name.
|
List<ClassInfo> |
getKnownDirectSubclasses(DotName className)
Gets all known direct subclasses of the specified class name.
|
void |
printAnnotations()
Print all annotations known by this index to stdout.
|
void |
printSubclasses()
Print all classes that have known subclasses, and all their subclasses
|
public static Index create(Map<DotName,List<AnnotationInstance>> annotations, Map<DotName,List<ClassInfo>> subclasses, Map<DotName,List<ClassInfo>> implementors, Map<DotName,ClassInfo> classes)
annotations - A map to lookup annotation instances by class namesubclasses - A map to lookup subclasses by super class nameimplementors - A map to lookup implementing classes by interface nameclasses - A map to lookup classes by class namepublic List<AnnotationInstance> getAnnotations(DotName annotationName)
getAnnotations in interface IndexViewannotationName - the name of the annotation to look forpublic List<ClassInfo> getKnownDirectSubclasses(DotName className)
getKnownDirectSubclasses in interface IndexViewclassName - the super class of the desired subclassespublic Collection<ClassInfo> getAllKnownSubclasses(DotName className)
IndexViewgetAllKnownSubclasses in interface IndexViewclassName - The classpublic List<ClassInfo> getKnownDirectImplementors(DotName className)
IndexView.getKnownDirectImplementors(DotName) for every implementing
interface found.getKnownDirectImplementors in interface IndexViewclassName - the super class of the desired subclassespublic Set<ClassInfo> getAllKnownImplementors(DotName interfaceName)
IndexViewgetAllKnownImplementors in interface IndexViewinterfaceName - The interfacepublic ClassInfo getClassByName(DotName className)
getClassByName in interface IndexViewclassName - the name of the classpublic Collection<ClassInfo> getKnownClasses()
getKnownClasses in interface IndexViewpublic void printAnnotations()
public void printSubclasses()
Copyright © 2013 JBoss, a division of Red Hat, Inc.. All rights reserved.