Package randoop.reflection
Interface ClassVisitor
-
- All Known Implementing Classes:
CheckRepExtractor
,ClassLiteralExtractor
,DeclarationExtractor
,DefaultClassVisitor
,OperationExtractor
,TestValueExtractor
,TypeExtractor
public interface ClassVisitor
ClassVisitor defines the interface for a visitor class that uses reflection to collect information about a class and its members.Note: if the visitor maintains state relative to
visitBefore(Class)
and other methods that could be disrupted by visiting member classes (currently just enums), then a stack should be used to maintain whatever state needs to be remembered. For instance,OperationExtractor
maintains the declaring class type for visited members, and when inner enums are visited the declaring class needs to be remembered and restored byvisitAfter(Class)
.- See Also:
ReflectionManager
,OperationExtractor
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
visit(Class<?> c, ReflectionManager reflectionManager)
Perform action on member class.void
visit(Enum<?> e)
Perform an action on an enum value.void
visit(Constructor<?> c)
Perform action on a constructor.void
visit(Field f)
Perform an action on a field.void
visit(Method m)
Perform an action on a method.void
visitAfter(Class<?> c)
Perform an action on a class.void
visitBefore(Class<?> c)
Perform an action on a class.
-
-
-
Method Detail
-
visit
void visit(Class<?> c, ReflectionManager reflectionManager)
Perform action on member class.The
ReflectionManager
is needed to allow visitors to initiate recursive visits if needed.- Parameters:
c
- the member classreflectionManager
- theReflectionManager
that called this visitor
-
visit
void visit(Constructor<?> c)
Perform action on a constructor.- Parameters:
c
- the constructor
-
visit
void visit(Method m)
Perform an action on a method.- Parameters:
m
- the method
-
visit
void visit(Field f)
Perform an action on a field.- Parameters:
f
- the field
-
visit
void visit(Enum<?> e)
Perform an action on an enum value.- Parameters:
e
- the enum value
-
visitBefore
void visitBefore(Class<?> c)
Perform an action on a class. Occurs before other visit methods are called.- Parameters:
c
- the class to visit
-
visitAfter
void visitAfter(Class<?> c)
Perform an action on a class. Called after other visit methods are called.- Parameters:
c
- the class to visit
-
-