Package com.puppycrawl.tools.checkstyle.api

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


    public void visitToken(DetailAST aAST)
    {
        if (shouldCheck(aAST)) {
            final FileContents contents = getFileContents();
            final int lineNo = aAST.getLineNo();
            final TextBlock cmt = contents.getJavadocBefore(lineNo);
            if (cmt == null) {
                log(lineNo, "javadoc.missing");
            }
            else if (ScopeUtils.isOuterMostType(aAST)) {
                // don't check author/version for inner classes
View Full Code Here


    /** {@inheritDoc} */
    public void visitToken(DetailAST aAST)
    {
        if (shouldCheck(aAST)) {
            final FileContents contents = getFileContents();
            final TextBlock cmt =
                contents.getJavadocBefore(aAST.getLineNo());

            checkComment(aAST, cmt);
        }
    }
View Full Code Here

    /** {@inheritDoc} */
    public void visitToken(DetailAST aAST)
    {
        if (shouldCheck(aAST)) {
            final FileContents contents = getFileContents();
            final TextBlock cmt =
                contents.getJavadocBefore(aAST.getLineNo());

            if (cmt == null) {
                log(aAST, "javadoc.missing");
            }
View Full Code Here

     * @param aComments the set of comments.
     */
    private void tagSuppressions(Collection aComments)
    {
        for (final Iterator iter = aComments.iterator(); iter.hasNext();) {
            final TextBlock comment = (TextBlock) iter.next();
            final int startLineNo = comment.getStartLineNo();
            final String[] text = comment.getText();
            tagCommentLine(text[0], startLineNo, comment.getStartColNo());
            for (int i = 1; i < text.length; i++) {
                tagCommentLine(text[i], startLineNo + i, 0);
            }
        }
    }
View Full Code Here

    @Override
    public void visitToken(DetailAST aAST)
    {
        if (shouldCheck(aAST)) {
            final FileContents contents = getFileContents();
            final TextBlock cmt =
                contents.getJavadocBefore(aAST.getLineNo());

            if (cmt == null) {
                log(aAST, "javadoc.missing");
            }
View Full Code Here

     */
    private void processJavadoc(DetailAST aAST)
    {
        final FileContents contents = getFileContents();
        final int lineNo = aAST.getLineNo();
        final TextBlock cmt = contents.getJavadocBefore(lineNo);
        if (cmt != null) {
            mReferenced.addAll(processJavadoc(cmt));
        }
    }
View Full Code Here

            return;
        }
        final Scope theScope = calculateScope(aAST);
        if (shouldCheck(aAST, theScope)) {
            final FileContents contents = getFileContents();
            final TextBlock cmt = contents.getJavadocBefore(aAST.getLineNo());

            if (cmt == null) {
                if (!isMissingJavadocAllowed(aAST)) {
                    log(aAST, "javadoc.missing");
                }
View Full Code Here

        if (shouldCheck(aAST)) {
            final FileContents contents = getFileContents();
            // Need to start searching for the comment before the annotations
            // that may exist. Even if annotations are not defined on the
            // package, the ANNOTATIONS AST is defined.
            final TextBlock cmt =
                contents.getJavadocBefore(aAST.getFirstChild().getLineNo());

            checkComment(aAST, cmt);
        }
    }
View Full Code Here

    @Override
    public void visitToken(DetailAST aAST)
    {
        final FileContents contents = getFileContents();
        final int lineNo = aAST.getLineNo();
        final TextBlock cmt =
            contents.getJavadocBefore(lineNo);
        if (cmt == null) {
            log(lineNo, "type.missingTag", mTag);
        }
        else {
            checkTag(lineNo, cmt.getText(), mTag, mTagRE, mTagFormatRE,
                mTagFormat);
        }
    }
View Full Code Here

        lines.addAll(cComments.keySet());

        for (Integer lineNo : lines) {
            final String line = getLines()[lineNo.intValue() - 1];
            String lineBefore = "";
            TextBlock comment = null;
            if (cppComments.containsKey(lineNo)) {
                comment = cppComments.get(lineNo);
                lineBefore = line.substring(0, comment.getStartColNo());
            }
            else if (cComments.containsKey(lineNo)) {
                final List<TextBlock> commentList = cComments.get(lineNo);
                comment = commentList.get(commentList.size() - 1);
                lineBefore = line.substring(0, comment.getStartColNo());
                if (comment.getText().length == 1) {
                    final String lineAfter =
                        line.substring(comment.getEndColNo() + 1).trim();
                    if (!"".equals(lineAfter)) {
                        // do not check comment which doesn't end line
                        continue;
                    }
                }
View Full Code Here

TOP

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

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.