Examples of branchContains()


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

            return;
        }

        final DetailAST modifiers = aAST.findFirstToken(TokenTypes.MODIFIERS);
        if ((modifiers != null)
            && modifiers.branchContains(TokenTypes.FINAL))
        {
            // do not check final variables
            return;
        }
View Full Code Here

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

    @Override
    public void visitToken(DetailAST aAST)
    {
        final DetailAST modifiers = aAST.findFirstToken(TokenTypes.MODIFIERS);
        if ((modifiers != null)
            && modifiers.branchContains(TokenTypes.ABSTRACT))
        {
            // should apply the check to abtract class
            return;
        }
View Full Code Here

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

        //but not attempted as it seems out of the scope of this
        //check.
        final DetailAST typeMods = aAST.findFirstToken(TokenTypes.MODIFIERS);
        final boolean isStaticInnerType =
                (typeMods != null)
                        && typeMods.branchContains(TokenTypes.LITERAL_STATIC);
        final FieldFrame frame =
                new FieldFrame(mCurrentFrame, isStaticInnerType);

        //add fields to container
        final DetailAST objBlock = aAST.findFirstToken(TokenTypes.OBJBLOCK);
View Full Code Here

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

                if (child.getType() == TokenTypes.VARIABLE_DEF) {
                    final String name =
                        child.findFirstToken(TokenTypes.IDENT).getText();
                    final DetailAST mods =
                        child.findFirstToken(TokenTypes.MODIFIERS);
                    if (mods.branchContains(TokenTypes.LITERAL_STATIC)) {
                        frame.addStaticField(name);
                    }
                    else {
                        frame.addInstanceField(name);
                    }
View Full Code Here

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

            case TokenTypes.STATIC_INIT:
                return true;
            case TokenTypes.METHOD_DEF:
                final DetailAST mods =
                    parent.findFirstToken(TokenTypes.MODIFIERS);
                return mods.branchContains(TokenTypes.LITERAL_STATIC);
            default:
                parent = parent.getParent();
            }
        }
        return false;
View Full Code Here

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

        if (!methodName.equals(expectedName)) {
            return false;
        }
        //void?
        final DetailAST typeAST = methodAST.findFirstToken(TokenTypes.TYPE);
        return typeAST.branchContains(TokenTypes.LITERAL_VOID);
    }

    /**
     * Decides whether to ignore an AST node that is the parameter of a
     * constructor.
 
View Full Code Here

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

        final DetailAST method = aAST.getParent().getParent();
        if (method.getType() != TokenTypes.METHOD_DEF) {
            return false;
        }
        final DetailAST mods = method.findFirstToken(TokenTypes.MODIFIERS);
        return ((mods != null) && mods.branchContains(TokenTypes.ABSTRACT));
    }

    /**
     * Set the ignore format to the specified regular expression.
     * @param aFormat a <code>String</code> value
View Full Code Here

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

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

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

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

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

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