Package org.eclipse.sisu.space
Class QualifierCache
java.lang.Object
org.eclipse.sisu.space.QualifierCache
- All Implemented Interfaces:
ClassVisitor
Caching
ClassVisitor that maintains a map of known Qualifier annotations.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate booleanprivate final booleanprivate static final Stringprivate static final StringFields inherited from interface org.eclipse.sisu.space.ClassVisitor
NON_INSTANTIABLE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidenterClass(int modifiers, String name, String _extends, String[] _implements) Enters the class definition.voidLeaves the class definition.(package private) booleanqualify(ClassSpace space, String desc) Scans the given annotation type to see if it is marked withQualifier.Seeds the cache with the fully-qualified names listed in the 'sisu.qualifiers' system property.visitAnnotation(String desc) Visits an annotation declared on the class.
-
Field Details
-
QUALIFIER_DESC
- See Also:
-
NAMED_DESC
- See Also:
-
cachedResults
-
isQualified
private boolean isQualified -
isStrict
private final boolean isStrict
-
-
Constructor Details
-
QualifierCache
public QualifierCache(boolean isStrict)
-
-
Method Details
-
enterClass
Description copied from interface:ClassVisitorEnters the class definition.- Specified by:
enterClassin interfaceClassVisitor- Parameters:
modifiers- The access modifiersname- The internal name, such as "javax/inject/Provider"_extends- Extends this superclass_implements- Implements these interfaces
-
visitAnnotation
Description copied from interface:ClassVisitorVisits an annotation declared on the class.- Specified by:
visitAnnotationin interfaceClassVisitor- Parameters:
desc- The JVM descriptor for the annotation class, such as "Ljavax/inject/Qualifier;"- Returns:
- Annotation visitor;
nullif it is not interested in visiting the annotation - See Also:
-
leaveClass
public void leaveClass()Description copied from interface:ClassVisitorLeaves the class definition.- Specified by:
leaveClassin interfaceClassVisitor
-
qualify
Scans the given annotation type to see if it is marked withQualifier.- Parameters:
space- The class spacedesc- The annotation descriptor- Returns:
trueif the annotation is a qualifier; otherwisefalse
-
seedResults
Seeds the cache with the fully-qualified names listed in the 'sisu.qualifiers' system property.- Returns:
- Seeded results
-