Package com.puppycrawl.tools.checkstyle.api

Examples of com.puppycrawl.tools.checkstyle.api.DetailAST.branchContains()


            return false;
        }

        // non-static, non-abstract?
        final DetailAST modifiers = aAST.findFirstToken(TokenTypes.MODIFIERS);
        if (modifiers.branchContains(TokenTypes.LITERAL_STATIC)
            || modifiers.branchContains(TokenTypes.ABSTRACT))
        {
            return false;
        }
View Full Code Here


        }

        // non-static, non-abstract?
        final DetailAST modifiers = aAST.findFirstToken(TokenTypes.MODIFIERS);
        if (modifiers.branchContains(TokenTypes.LITERAL_STATIC)
            || modifiers.branchContains(TokenTypes.ABSTRACT))
        {
            return false;
        }

        // named "equals"?
View Full Code Here

     */
    public static boolean isAbstract(DetailAST aAST)
    {
        final DetailAST mods = aAST.findFirstToken(TokenTypes.MODIFIERS);
        return ((mods != null)
            && mods.branchContains(TokenTypes.ABSTRACT));
    }

    /**
     * Determines whether an AST defines a final element.
     * @param aAST the AST to check.
View Full Code Here

     */
    public static boolean isFinal(DetailAST aAST)
    {
        final DetailAST mods = aAST.findFirstToken(TokenTypes.MODIFIERS);
        return ((mods != null)
            && mods.branchContains(TokenTypes.FINAL));
    }

    /**
     * Determines whether an AST defines a public element.
     * @param aAST the AST to check.
View Full Code Here

     */
    public static boolean isPublic(DetailAST aAST)
    {
        final DetailAST mods = aAST.findFirstToken(TokenTypes.MODIFIERS);
        return ((mods != null)
            && mods.branchContains(TokenTypes.LITERAL_PUBLIC));
    }

    /**
     * Determines whether an AST defines a static element.
     * @param aAST the AST to check.
View Full Code Here

     */
    public static boolean isStatic(DetailAST aAST)
    {
        final DetailAST mods = aAST.findFirstToken(TokenTypes.MODIFIERS);
        return ((mods != null)
            && mods.branchContains(TokenTypes.LITERAL_STATIC));
    }

    /**
     * Determines whether an AST defines a void method.
     * @param aAST the AST to check.
View Full Code Here

     */
    public static boolean isVoid(DetailAST aAST)
    {
        final DetailAST type = aAST.findFirstToken(TokenTypes.TYPE);
        return ((type != null)
            && type.branchContains(TokenTypes.LITERAL_VOID));
    }

    /**
     * Determines whether an AST node declares an implementation of an
     * interface.
 
View Full Code Here

    protected final boolean mustCheckName(DetailAST aAST)
    {
        final DetailAST modifiersAST =
            aAST.findFirstToken(TokenTypes.MODIFIERS);
        final boolean isFinal = (modifiersAST != null)
            && modifiersAST.branchContains(TokenTypes.FINAL);
        return (!isFinal && ScopeUtils.isLocalVariableDef(aAST));
    }
}
View Full Code Here

    protected final boolean mustCheckName(DetailAST aAST)
    {
        final DetailAST modifiersAST =
            aAST.findFirstToken(TokenTypes.MODIFIERS);
        final boolean isFinal = (modifiersAST != null)
            && modifiersAST.branchContains(TokenTypes.FINAL);
        return (isFinal && ScopeUtils.isLocalVariableDef(aAST));
    }
}
View Full Code Here

            return;
        }

        // method is ok if it is private or abstract or final
        final DetailAST modifiers = aAST.findFirstToken(TokenTypes.MODIFIERS);
        if (modifiers.branchContains(TokenTypes.LITERAL_PRIVATE)
            || modifiers.branchContains(TokenTypes.ABSTRACT)
            || modifiers.branchContains(TokenTypes.FINAL)
            || modifiers.branchContains(TokenTypes.LITERAL_STATIC))
        {
            return;
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.