Examples of branchContains()


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

            if (type == TokenTypes.CTOR_DEF) {
                hasDefaultCtor = false;
                final DetailAST modifiers =
                    child.findFirstToken(TokenTypes.MODIFIERS);
                if (!modifiers.branchContains(TokenTypes.LITERAL_PRIVATE)
                    && !modifiers.branchContains(TokenTypes.LITERAL_PROTECTED))
                {
                    // treat package visible as public
                    // for the purpose of this Check
                    hasPublicCtor = true;
                }
View Full Code Here

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

    private boolean checkModifiers(DetailAST aMethod)
    {
        final DetailAST modifiers =
            aMethod.findFirstToken(TokenTypes.MODIFIERS);

        return modifiers.branchContains(TokenTypes.LITERAL_PUBLIC)
            && modifiers.branchContains(TokenTypes.LITERAL_STATIC);
    }

    /**
     * Checks that return type is <code>void</code>.
View Full Code Here

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

    {
        final DetailAST modifiers =
            aMethod.findFirstToken(TokenTypes.MODIFIERS);

        return modifiers.branchContains(TokenTypes.LITERAL_PUBLIC)
            && modifiers.branchContains(TokenTypes.LITERAL_STATIC);
    }

    /**
     * Checks that return type is <code>void</code>.
     * @param aMethod the METHOD_DEF node
View Full Code Here

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

    protected final boolean mustCheckName(DetailAST aAST)
    {
        final DetailAST modifiersAST =
            aAST.findFirstToken(TokenTypes.MODIFIERS);
        final boolean isStatic = (modifiersAST != null)
            && modifiersAST.branchContains(TokenTypes.LITERAL_STATIC);
        final boolean isFinal = (modifiersAST != null)
            && modifiersAST.branchContains(TokenTypes.FINAL);

        return (isStatic
                && !isFinal
View Full Code Here

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

        final DetailAST modifiersAST =
            aAST.findFirstToken(TokenTypes.MODIFIERS);
        final boolean isStatic = (modifiersAST != null)
            && modifiersAST.branchContains(TokenTypes.LITERAL_STATIC);
        final boolean isFinal = (modifiersAST != null)
            && modifiersAST.branchContains(TokenTypes.FINAL);

        return (isStatic
                && !isFinal
                && !ScopeUtils.inInterfaceOrAnnotationBlock(aAST));
    }
View Full Code Here

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

        DetailAST parent = aAST.getParent();
        while (parent != null) {
            if (parent.getType() == TokenTypes.METHOD_DEF) {
                final DetailAST modifiers =
                    parent.findFirstToken(TokenTypes.MODIFIERS);
                return modifiers.branchContains(TokenTypes.ABSTRACT);
            }
            parent = parent.getParent();
        }
        return false;
    }
View Full Code Here

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

    protected final boolean mustCheckName(DetailAST aAST)
    {
        final DetailAST modifiersAST =
            aAST.findFirstToken(TokenTypes.MODIFIERS);
        final boolean isStatic = (modifiersAST != null)
            && modifiersAST.branchContains(TokenTypes.LITERAL_STATIC);

        return (!isStatic && !ScopeUtils.inInterfaceOrAnnotationBlock(aAST)
            && !ScopeUtils.isLocalVariableDef(aAST))
            && (modifiersAST != null)
            && shouldCheckInScope(modifiersAST);
View Full Code Here

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

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

        }

        // 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

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

        }

        // explicit constant
        final DetailAST modifiersAST =
                varDefAST.findFirstToken(TokenTypes.MODIFIERS);
        if (modifiersAST.branchContains(TokenTypes.FINAL)) {
            return varDefAST;
        }

        return null;
    }
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.