Class ServiceLocatorTestRule.Visitor
java.lang.Object
org.objectweb.asm.ClassVisitor
org.jvnet.hk2.testing.junit.internal.ClassVisitorImpl
org.jvnet.hk2.testing.junit.ServiceLocatorTestRule.Visitor
- Enclosing class:
ServiceLocatorTestRule<T>
A very, very special-purpose
ClassVisitorImpl suitable
only for use by the ServiceLocatorTestRule class to
determine efficiently whether a given Class is annotated
with Service or not.- Since:
- 2.4.0-b33
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate StringThe fully qualified class name of theClassbeing visited.Fields inherited from class org.objectweb.asm.ClassVisitor
api, cv -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal voidvisit(int version, int access, String name, String signature, String superName, String[] interfaces) Called when a class file is encountered and internally records its fully qualified class name.final org.objectweb.asm.AnnotationVisitorvisitAnnotation(String annotationClassDescriptor, boolean visible) If the suppliedannotationClassDescriptoris equal to "Lorg/jvnet/hk2/annotations/Service;", and if the suppliedvisibleparameter istrue, attempts to load theClassencountered in the prior (guaranteed) call to thevisit(int, int, String, String, String, String[])method, and, if that is successful, adds the resultingClassto the invalid input: '{@linkplain ServiceLocatorTestRule.Visitor#ServiceLocatorTestRule.Visitor(Set, boolean)'SetofClasses that was supplied at construction time}.final voidvisitEnd()Does nothing when invoked.Methods inherited from class org.objectweb.asm.ClassVisitor
getDelegate, visitAttribute, visitField, visitInnerClass, visitMethod, visitModule, visitNestHost, visitNestMember, visitOuterClass, visitPermittedSubclass, visitRecordComponent, visitSource, visitTypeAnnotation
-
Field Details
-
className
The fully qualified class name of theClassbeing visited.This field may be
null.This field is set by the
visit(int, int, String, String, String, String[])method.- See Also:
-
classes
ASetofClasses that will be added to by thevisitAnnotation(String, boolean)method.This field is never
null.- See Also:
-
-
Constructor Details
-
Visitor
Creates a newServiceLocatorTestRule.Visitor.- Parameters:
classes- ASetofClasses that will be added to by thevisitAnnotation(String, boolean)method; must not benull; must be mutableverbose- whether or not additional information should be output- See Also:
-
-
Method Details
-
visit
public final void visit(int version, int access, String name, String signature, String superName, String[] interfaces) Called when a class file is encountered and internally records its fully qualified class name.It is guaranteed that this method will be called before the
visitAnnotation(String, boolean)method on the current thread.- Overrides:
visitin classClassVisitorImpl- Parameters:
version- ignoredaccess- ignoredname- the name of the class, whose package segments are separated with slashes ("/"); may benullsignature- ignoredsuperName- ignoredinterfaces- ignored- See Also:
-
visitAnnotation
public final org.objectweb.asm.AnnotationVisitor visitAnnotation(String annotationClassDescriptor, boolean visible) If the suppliedannotationClassDescriptoris equal to "Lorg/jvnet/hk2/annotations/Service;", and if the suppliedvisibleparameter istrue, attempts to load theClassencountered in the prior (guaranteed) call to thevisit(int, int, String, String, String, String[])method, and, if that is successful, adds the resultingClassto the invalid input: '{@linkplain ServiceLocatorTestRule.Visitor#ServiceLocatorTestRule.Visitor(Set, boolean)'SetofClasses that was supplied at construction time}.- Overrides:
visitAnnotationin classClassVisitorImpl- Parameters:
annotationClassDescriptor- the descriptor for the annotation being visited; may benullvisible- whether the annotation is visible or not- Returns:
nullwhen invoked
-
visitEnd
public final void visitEnd()Does nothing when invoked.- Overrides:
visitEndin classClassVisitorImpl
-