Examples of FullIdent


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))
                {
                    final FullIdent fi = FullIdent.createFullIdent(child);
                    checkException(fi, knownExcs);
                }
                child = (DetailAST) child.getNextSibling();
            }
        }
View Full Code Here

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

    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

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

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

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

    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

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))
                {
                    final 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

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

        if (aAST.getType() == TokenTypes.PACKAGE_DEF) {
            mPkgName = FullIdent.createFullIdent(
                    aAST.getLastChild().getPreviousSibling()).getText();
        }
        else if (aAST.getType() == TokenTypes.IMPORT) {
            final FullIdent imp = FullIdent.createFullIdentBelow(aAST);
            if (fromPackage(imp.getText(), "java.lang")) {
                log(aAST.getLineNo(), aAST.getColumnNo(), "import.lang",
                    imp.getText());
            }
            else if (fromPackage(imp.getText(), mPkgName)) {
                log(aAST.getLineNo(), aAST.getColumnNo(), "import.same",
                    imp.getText());
            }
            // Check for a duplicate import
            final Iterator it = mImports.iterator();
            while (it.hasNext()) {
                final FullIdent full = (FullIdent) it.next();
                if (imp.getText().equals(full.getText())) {
                    log(aAST.getLineNo(),
                        aAST.getColumnNo(),
                        "import.duplicate",
                        new Integer(full.getLineNo()),
                        imp.getText());
                }
            }

            mImports.add(imp);
        }
        else {
            // Check for a duplicate static import
            final FullIdent imp =
                FullIdent.createFullIdent(
                    aAST.getLastChild().getPreviousSibling());
            final Iterator it = mStaticImports.iterator();
            while (it.hasNext()) {
                final FullIdent full = (FullIdent) it.next();
                if (imp.getText().equals(full.getText())) {
                    log(aAST.getLineNo(),
                        aAST.getColumnNo(),
                        "import.duplicate",
                        new Integer(full.getLineNo()),
                        imp.getText());
                }
            }

            mStaticImports.add(imp);
View Full Code Here

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

     * 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) {
            mImports.add(name.getText());
        }
    }
View Full Code Here

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

                final String alias =
                    param.findFirstToken(TokenTypes.IDENT).getText();
                final DetailAST bounds =
                    param.findFirstToken(TokenTypes.TYPE_UPPER_BOUNDS);
                if (bounds != null) {
                    final FullIdent name =
                        FullIdent.createFullIdentBelow(bounds);
                    final ClassInfo ci =
                        createClassInfo(new Token(name), getCurrentClassName());
                    paramsMap.put(alias, ci);
                }
View Full Code Here

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

    /** {@inheritDoc} */
    public void visitToken(final DetailAST aAST)
    {
        if (aAST.getType() == TokenTypes.PACKAGE_DEF) {
            final DetailAST nameAST = aAST.getLastChild().getPreviousSibling();
            final FullIdent full = FullIdent.createFullIdent(nameAST);
            if (mRoot == null) {
                log(nameAST, "import.control.missing.file");
            }
            else {
                mInPkg = full.getText();
                mCurrentLeaf = mRoot.locateFinest(mInPkg);
                if (mCurrentLeaf == null) {
                    log(nameAST, "import.control.unknown.pkg");
                }
            }
        }
        else if (mCurrentLeaf != null) {
            final FullIdent imp;
            if (aAST.getType() == TokenTypes.IMPORT) {
                imp = FullIdent.createFullIdentBelow(aAST);
            }
            else {
                // know it is a static import
                imp = FullIdent.createFullIdent((DetailAST) aAST
                        .getFirstChild().getNextSibling());
            }
            final AccessResult access = mCurrentLeaf.checkAccess(imp.getText(),
                    mInPkg);
            if (!AccessResult.ALLOWED.equals(access)) {
                log(aAST, "import.control.disallowed", imp.getText());
            }
        }
    }
View Full Code Here

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

    /** {@inheritDoc} */
    public void visitToken(DetailAST aAST)
    {
        final DetailAST nameAST = aAST.getLastChild().getPreviousSibling();
        final FullIdent full = FullIdent.createFullIdent(nameAST);
        if (!getRegexp().matcher(full.getText()).find()) {
            log(full.getLineNo(),
                full.getColumnNo(),
                "name.invalidPattern",
                full.getText(),
                getFormat());
        }
    }
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.