Package com.puppycrawl.tools.checkstyle.api

Examples of com.puppycrawl.tools.checkstyle.api.FullIdent


            DetailAST child = (DetailAST) throwsAST.getFirstChild();
            while (child != null) {
                if ((child.getType() == TokenTypes.IDENT)
                    || (child.getType() == TokenTypes.DOT))
                {
                    FullIdent fi = FullIdent.createFullIdent(child);
                    final ExceptionInfo ei =
                        new ExceptionInfo(new Token(fi), getCurrentClassName());
                    retVal.add(ei);
                }
                child = (DetailAST) child.getNextSibling();
View Full Code Here


        // parameter type "Object"?
        final DetailAST paramNode =
            paramsNode.findFirstToken(TokenTypes.PARAMETER_DEF);
        final DetailAST typeNode = paramNode.findFirstToken(TokenTypes.TYPE);
        final FullIdent fullIdent = FullIdent.createFullIdentBelow(typeNode);
        final String name = fullIdent.getText();
        return (name.equals("Object") || name.equals("java.lang.Object"));
    }
View Full Code Here

    }

    /** {@inheritDoc} */
    public void visitToken(DetailAST aAST)
    {
        final FullIdent imp;
        if (aAST.getType() == TokenTypes.IMPORT) {
            imp = FullIdent.createFullIdentBelow(aAST);
        }
        else {
            imp = FullIdent.createFullIdent(
                (DetailAST) aAST.getFirstChild().getNextSibling());
        }
        if (isIllegalImport(imp.getText())) {
            log(aAST.getLineNo(),
                aAST.getColumnNo(),
                "import.illegal",
                imp.getText());
        }
    }
View Full Code Here

    }

    /** {@inheritDoc} */
    public void visitToken(DetailAST aAST)
    {
        final FullIdent name = FullIdent.createFullIdentBelow(aAST);
        if ((name != null) && name.getText().endsWith(".*")) {
            boolean exempt = false;
            for (int i = 0; i < mExcludes.length && !exempt; i++) {
                if (name.getText().equals(mExcludes[i])) {
                    exempt = true;
                }
            }
            if (!exempt) {
                log(aAST.getLineNo(), "import.avoidStar", name.getText());
            }
        }
    }
View Full Code Here

    public void finishTree(DetailAST aRootAST)
    {
        // loop over all the imports to see if referenced.
        final Iterator it = mImports.iterator();
        while (it.hasNext()) {
            final FullIdent imp = (FullIdent) it.next();

            if (!mReferenced.contains(Utils.baseClassname(imp.getText()))) {
                log(imp.getLineNo(),
                    imp.getColumnNo(),
                    "import.unused", imp.getText());
            }
        }
    }
View Full Code Here

     * Collects the details of imports.
     * @param aAST node containing the import details
     */
    private void processImport(DetailAST aAST)
    {
        final FullIdent name = FullIdent.createFullIdentBelow(aAST);
        if ((name != null) && !name.getText().endsWith(".*")) {
            mImports.add(name);
        }
    }
View Full Code Here

     * Collects the details of static imports.
     * @param aAST node containing the static import details
     */
    private void processStaticImport(DetailAST aAST)
    {
        final FullIdent name =
            FullIdent.createFullIdent(
                (DetailAST) aAST.getFirstChild().getNextSibling());
        if ((name != null) && !name.getText().endsWith(".*")) {
            mImports.add(name);
        }
    }
View Full Code Here

    }

    /** {@inheritDoc} */
    public void visitToken(DetailAST aAST)
    {
        final FullIdent ident;
        boolean isStatic;
        if (aAST.getType() == TokenTypes.IMPORT) {
            ident = FullIdent.createFullIdentBelow(aAST);
            isStatic = false;
        }
        else {
            ident = FullIdent.createFullIdent(
                (DetailAST) aAST.getFirstChild().getNextSibling());
            isStatic = true;
        }

        if (ident != null) {
            String name = ident.getText();
            int groupIdx = getGroupNumber(name);
            final int line = ident.getLineNo();

            if (groupIdx > mLastGroup) {
                if (!mBeforeFirstImport && mSeparated) {
                    // This check should be made more robust to handle
                    // comments and imports that span more than one line.
View Full Code Here

    public void visitToken(DetailAST aDetailAST)
    {
        final DetailAST paramDef =
            aDetailAST.findFirstToken(TokenTypes.PARAMETER_DEF);
        final DetailAST excType = paramDef.findFirstToken(TokenTypes.TYPE);
        final FullIdent ident = CheckUtils.createFullType(excType);

        if (isIllegalClassName(ident.getText())) {
            log(aDetailAST, "illegal.catch", ident.getText());
        }
    }
View Full Code Here

TOP

Related Classes of com.puppycrawl.tools.checkstyle.api.FullIdent

Copyright © 2018 www.massapicom. 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.