Package randoop.reflection
Class CheckRepExtractor
- java.lang.Object
-
- randoop.reflection.DefaultClassVisitor
-
- randoop.reflection.CheckRepExtractor
-
- All Implemented Interfaces:
ClassVisitor
class CheckRepExtractor extends DefaultClassVisitor
CheckRepExtractor
is aClassVisitor
that inspects the methods passed to it to see if they are annotated withCheckRep
, are non-static, and have either aboolean
orvoid
return type.
-
-
Field Summary
Fields Modifier and Type Field Description private ContractSet
contracts
The set of accumulatedObjectContract
objects.
-
Constructor Summary
Constructors Constructor Description CheckRepExtractor(ContractSet contracts)
Creates a visitor with an empty contracts set.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private static void
printDetectedAnnotatedCheckRepMethod(Method m)
Prints the log message indicating that a CheckRep method has been found.void
visit(Method m)
Perform an action on a method.-
Methods inherited from class randoop.reflection.DefaultClassVisitor
toString, visit, visit, visit, visit, visitAfter, visitBefore
-
-
-
-
Field Detail
-
contracts
private ContractSet contracts
The set of accumulatedObjectContract
objects.
-
-
Constructor Detail
-
CheckRepExtractor
CheckRepExtractor(ContractSet contracts)
Creates a visitor with an empty contracts set.- Parameters:
contracts
- the set of contracts
-
-
Method Detail
-
visit
public void visit(Method m)
Perform an action on a method.If the method is annotated with
CheckRep
, non-static, and with boolean or void return type, then aCheckRepContract
for the method is added to the contracts set.- Specified by:
visit
in interfaceClassVisitor
- Overrides:
visit
in classDefaultClassVisitor
- Parameters:
m
- the method
-
printDetectedAnnotatedCheckRepMethod
private static void printDetectedAnnotatedCheckRepMethod(Method m)
Prints the log message indicating that a CheckRep method has been found.- Parameters:
m
- the method
-
-