Class AbstractAccessControlNameCheck

    • Field Detail

      • applyToPublic

        private boolean applyToPublic
        If true, applies the check be public members.
      • applyToProtected

        private boolean applyToProtected
        If true, applies the check be protected members.
      • applyToPackage

        private boolean applyToPackage
        If true, applies the check be "package" members.
      • applyToPrivate

        private boolean applyToPrivate
        If true, applies the check be private members.
    • Constructor Detail

      • AbstractAccessControlNameCheck

        protected AbstractAccessControlNameCheck​(String format)
        Creates a new AbstractAccessControlNameCheck instance.
        Parameters:
        format - format to check with
    • Method Detail

      • mustCheckName

        protected boolean mustCheckName​(DetailAST ast)
        Description copied from class: AbstractNameCheck
        Decides whether the name of an AST should be checked against the format regexp.
        Specified by:
        mustCheckName in class AbstractNameCheck
        Parameters:
        ast - the AST to check.
        Returns:
        true if the IDENT subnode of ast should be checked against the format regexp.
      • shouldCheckInScope

        protected boolean shouldCheckInScope​(DetailAST modifiers)
        Should we check member with given modifiers.
        Parameters:
        modifiers - modifiers of member to check.
        Returns:
        true if we should check such member.
      • isPublic

        private static boolean isPublic​(DetailAST modifiers)
        Checks if given modifiers has public access. There are 2 cases - it is either has explicit modifier, or it is in annotation or interface.
        Parameters:
        modifiers - - modifiers to check
        Returns:
        true if public
      • setApplyToPublic

        public void setApplyToPublic​(boolean applyTo)
        Setter to control if check should apply to public members.
        Parameters:
        applyTo - new value of the property.
      • setApplyToProtected

        public void setApplyToProtected​(boolean applyTo)
        Setter to control if check should apply to protected members.
        Parameters:
        applyTo - new value of the property.
      • setApplyToPackage

        public void setApplyToPackage​(boolean applyTo)
        Setter to control if check should apply to package-private members.
        Parameters:
        applyTo - new value of the property.
      • setApplyToPrivate

        public void setApplyToPrivate​(boolean applyTo)
        Setter to control if check should apply to private members.
        Parameters:
        applyTo - new value of the property.