Examples of findFirstToken()


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

            if (tag.getArg1().startsWith("<") && tag.getArg1().endsWith(">")) {
                // Loop looking for matching type param
                final Iterator<DetailAST> typeParamsIt = typeParams.iterator();
                while (typeParamsIt.hasNext()) {
                    final DetailAST typeParam = typeParamsIt.next();
                    if (typeParam.findFirstToken(TokenTypes.IDENT).getText()
                            .equals(
                                    tag.getArg1().substring(1,
                                            tag.getArg1().length() - 1)))
                    {
                        found = true;
View Full Code Here

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

                log(param, "javadoc.expectedTag", "@param", param.getText());
            }

            for (DetailAST typeParam : typeParams) {
                log(typeParam, "javadoc.expectedTag", "@param", "<"
                        + typeParam.findFirstToken(TokenTypes.IDENT).getText()
                        + ">");
            }
        }
    }
View Full Code Here

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

    {
        boolean retVal = false;
        if (aAST.getType() == TokenTypes.METHOD_DEF) {
            final DetailAST typeAST = aAST.findFirstToken(TokenTypes.TYPE);
            if ((typeAST != null)
                && (typeAST.findFirstToken(TokenTypes.LITERAL_VOID) == null))
            {
                retVal = true;
            }
        }
        return retVal;
View Full Code Here

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

        final List<String> typeParamNames = Lists.newArrayList();
        if (typeParameters != null) {
            final DetailAST typeParam =
                typeParameters.findFirstToken(TokenTypes.TYPE_PARAMETER);
            typeParamNames.add(
                typeParam.findFirstToken(TokenTypes.IDENT).getText());

            DetailAST sibling = (DetailAST) typeParam.getNextSibling();
            while (sibling != null) {
                if (sibling.getType() == TokenTypes.TYPE_PARAMETER) {
                    typeParamNames.add(
View Full Code Here

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

            DetailAST sibling = (DetailAST) typeParam.getNextSibling();
            while (sibling != null) {
                if (sibling.getType() == TokenTypes.TYPE_PARAMETER) {
                    typeParamNames.add(
                        sibling.findFirstToken(TokenTypes.IDENT).getText());
                }
                sibling = (DetailAST) sibling.getNextSibling();
            }
        }
View Full Code Here

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

    private boolean checkTry(final DetailAST aAST, boolean aUseBreak,
                             boolean aUseContinue)
    {
        final DetailAST finalStmt = aAST.getLastChild();
        if (finalStmt.getType() == TokenTypes.LITERAL_FINALLY) {
            return isTerminated(finalStmt.findFirstToken(TokenTypes.SLIST),
                                aUseBreak, aUseContinue);
        }

        boolean isTerminated = isTerminated((DetailAST) aAST.getFirstChild(),
                                            aUseBreak, aUseContinue);
View Full Code Here

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

        }

        // let's check return type
        final DetailAST typeAST = aAST.findFirstToken(TokenTypes.TYPE);
        final boolean isArray =
            (typeAST.findFirstToken(TokenTypes.ARRAY_DECLARATOR) != null);
        final String type = CheckUtils.createFullType(typeAST).getText();
        if (isArray
            || (!"Test".equals(type)
            && !"junit.framework.Test".equals(type)))
        {
View Full Code Here

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

     */
    private void checkReturnValue(DetailAST aAST, String aName)
    {
        final DetailAST returnValueAST = aAST.findFirstToken(TokenTypes.TYPE);

        if (returnValueAST.findFirstToken(TokenTypes.LITERAL_VOID) == null) {
            log(aAST, "junit.method.return.type", aName, "void");
        }
    }

    /**
 
View Full Code Here

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

        if (objBlock != null) {
            DetailAST child = (DetailAST) objBlock.getFirstChild();
            while (child != null) {
                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);
                    }
View Full Code Here

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

        final DetailAST slist = getMainAst().findFirstToken(TokenTypes.SLIST);
        if (slist == null) {
            return null;
        }

        return slist.findFirstToken(TokenTypes.RCURLY);
    }

    /**
     * Check the indentation of the left curly brace.
     */
 
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.