class CheckRepExtractor extends DefaultClassVisitor
CheckRepExtractor
is a ClassVisitor
that inspects the methods passed to it to see
if they are annotated with CheckRep
, are non-static, and have either a boolean
or void
return type.Modifier and Type | Field and Description |
---|---|
private ContractSet |
contracts
The set of accumulated
ObjectContract objects. |
Constructor and Description |
---|
CheckRepExtractor(ContractSet contracts)
Creates a visitor with an empty contracts set.
|
Modifier and Type | Method and Description |
---|---|
private static void |
printDetectedAnnotatedCheckRepMethod(java.lang.reflect.Method m)
Prints the log message indicating that a CheckRep method has been found.
|
void |
visit(java.lang.reflect.Method m)
Perform an action on a method.
|
toString, visit, visit, visit, visit, visitAfter, visitBefore
private ContractSet contracts
ObjectContract
objects.CheckRepExtractor(ContractSet contracts)
contracts
- the set of contractspublic void visit(java.lang.reflect.Method m)
If the method is annotated with CheckRep
, non-static, and with boolean or
void return type, then a CheckRepContract
for the method is added to
the contracts set.
visit
in interface ClassVisitor
visit
in class DefaultClassVisitor
m
- the methodprivate static void printDetectedAnnotatedCheckRepMethod(java.lang.reflect.Method m)
m
- the method