Class RequireThisCheck.ClassFrame

    • Method Detail

      • addStaticMember

        public void addStaticMember​(DetailAST ident)
        Adds static member's ident.
        Parameters:
        ident - an ident of static member of the class.
      • addStaticMethod

        public void addStaticMethod​(DetailAST ident)
        Adds static method's name.
        Parameters:
        ident - an ident of static method of the class.
      • addInstanceMember

        public void addInstanceMember​(DetailAST ident)
        Adds instance member's ident.
        Parameters:
        ident - an ident of instance member of the class.
      • addInstanceMethod

        public void addInstanceMethod​(DetailAST ident)
        Adds instance method's name.
        Parameters:
        ident - an ident of instance method of the class.
      • hasInstanceMember

        public boolean hasInstanceMember​(DetailAST ident)
        Checks if a given name is a known instance member of the class.
        Parameters:
        ident - the IDENT ast of the name to check.
        Returns:
        true is the given name is a name of a known instance member of the class.
      • hasInstanceMethod

        public boolean hasInstanceMethod​(DetailAST ident)
        Checks if a given name is a known instance method of the class.
        Parameters:
        ident - the IDENT ast of the method call to check.
        Returns:
        true if the given ast is correspondent to a known instance method of the class.
      • hasStaticMethod

        public boolean hasStaticMethod​(DetailAST ident)
        Checks if a given name is a known static method of the class.
        Parameters:
        ident - the IDENT ast of the method call to check.
        Returns:
        true is the given ast is correspondent to a known instance method of the class.
      • hasFinalField

        public boolean hasFinalField​(DetailAST instanceMember)
        Checks whether given instance member has final modifier.
        Parameters:
        instanceMember - an instance member of a class.
        Returns:
        true if given instance member has final modifier.
      • containsMethod

        private boolean containsMethod​(DetailAST methodToFind)
        Check whether the frame contains a given method.
        Parameters:
        methodToFind - the AST of the method to find.
        Returns:
        true, if a method with the same name and number of parameters is found.
      • containsMethodDef

        private static boolean containsMethodDef​(Set<DetailAST> set,
                                                 DetailAST ident)
        Whether the set contains a method definition with the same name and number of parameters.
        Parameters:
        set - the set of definitions.
        ident - the specified method call IDENT ast.
        Returns:
        true if the set contains a definition with the same name and number of parameters.
      • isSimilarSignature

        private static boolean isSimilarSignature​(DetailAST ident,
                                                  DetailAST ast)
        Whether the method definition has the same name and number of parameters.
        Parameters:
        ident - the specified method call IDENT ast.
        ast - the ast of a method definition to compare with.
        Returns:
        true if a method definition has the same name and number of parameters as the method call.