Package com.puppycrawl.tools.checkstyle.api

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


    /** {@inheritDoc} */
    @Override
    public void visitToken(final DetailAST aAST)
    {
        final TextBlock javadoc =
            this.getFileContents().getJavadocBefore(aAST.getLineNo());


        final boolean containsTag = this.containsJavadocTag(javadoc);
        if (containsTag && !JavadocTagInfo.INHERIT_DOC.isValidOn(aAST)) {
View Full Code Here


    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} */
    @Override
    public void visitToken(final DetailAST aAST)
    {
        final TextBlock javadoc =
            this.getFileContents().getJavadocBefore(aAST.getLineNo());

        final boolean containsAnnotation =
            AnnotationUtility.containsAnnotation(aAST, DEPRECATED)
            || AnnotationUtility.containsAnnotation(aAST, FQ_DEPRECATED);
View Full Code Here

    }

    protected void processJavaDocLinkParameters( DetailAST aAST ) {
        final FileContents contents = getFileContents();
        final int lineNo = aAST.getLineNo();
        final TextBlock cmt = contents.getJavadocBefore(lineNo);
        if (cmt != null) {
            final JavadocTags tags = JavaDocUtil.getJavadocTags(cmt, JavadocUtils.JavadocTagType.ALL);
            for (final JavadocTag tag : tags.getValidTags()) {
                processJavaDocTag(tag);
            }
View Full Code Here

     * @param aComments the set of comments.
     */
    private void tagSuppressions(Collection aComments)
    {
        for (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

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

            final Integer lineNo = (Integer) linesIter.next();

            final String line = getLines()[lineNo.intValue() - 1];
            String lineBefore = "";
            if (cppComments.containsKey(lineNo)) {
                final TextBlock comment = (TextBlock) cppComments.get(lineNo);
                lineBefore = line.substring(0, comment.getStartColNo());
            }
            else if (cComments.containsKey(lineNo)) {
                final List commentList = (List) cComments.get(lineNo);
                final TextBlock comment =
                    (TextBlock) 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

     */
    protected final void processAST(DetailAST aAST)
    {
        if (shouldCheck(aAST)) {
            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

    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());

            if (cmt == null) {
                log(aAST, "javadoc.missing");
            }
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.