Class CheckRepExtractor

  • All Implemented Interfaces:
    ClassVisitor

    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.
    • 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 a CheckRepContract for the method is added to the contracts set.

        Specified by:
        visit in interface ClassVisitor
        Overrides:
        visit in class DefaultClassVisitor
        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