Package org.jvnet.hk2.testing.junit
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 String
The fully qualified class name of theClass
being visited.Fields inherited from class org.objectweb.asm.ClassVisitor
api, cv
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal 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.final org.objectweb.asm.AnnotationVisitor
visitAnnotation
(String annotationClassDescriptor, boolean visible) If the suppliedannotationClassDescriptor
is equal to "Lorg/jvnet/hk2/annotations/Service;
", and if the suppliedvisible
parameter istrue
, attempts to load theClass
encountered in the prior (guaranteed) call to thevisit(int, int, String, String, String, String[])
method, and, if that is successful, adds the resultingClass
to the invalid input: '{@linkplain ServiceLocatorTestRule.Visitor#ServiceLocatorTestRule.Visitor(Set, boolean)'Set
ofClass
es that was supplied at construction time}.final void
visitEnd()
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 theClass
being visited.This field may be
null
.This field is set by the
visit(int, int, String, String, String, String[])
method.- See Also:
-
classes
ASet
ofClass
es 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
- ASet
ofClass
es 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:
visit
in classClassVisitorImpl
- Parameters:
version
- ignoredaccess
- ignoredname
- the name of the class, whose package segments are separated with slashes ("/
"); may benull
signature
- ignoredsuperName
- ignoredinterfaces
- ignored- See Also:
-
visitAnnotation
public final org.objectweb.asm.AnnotationVisitor visitAnnotation(String annotationClassDescriptor, boolean visible) If the suppliedannotationClassDescriptor
is equal to "Lorg/jvnet/hk2/annotations/Service;
", and if the suppliedvisible
parameter istrue
, attempts to load theClass
encountered in the prior (guaranteed) call to thevisit(int, int, String, String, String, String[])
method, and, if that is successful, adds the resultingClass
to the invalid input: '{@linkplain ServiceLocatorTestRule.Visitor#ServiceLocatorTestRule.Visitor(Set, boolean)'Set
ofClass
es that was supplied at construction time}.- Overrides:
visitAnnotation
in classClassVisitorImpl
- Parameters:
annotationClassDescriptor
- the descriptor for the annotation being visited; may benull
visible
- whether the annotation is visible or not- Returns:
null
when invoked
-
visitEnd
public final void visitEnd()Does nothing when invoked.- Overrides:
visitEnd
in classClassVisitorImpl
-