Package com.puppycrawl.tools.checkstyle.api

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


    @Override
    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


        }

        try {
            getMessageDispatcher().fireFileStarted(fileName);
            final String[] lines = Utils.getLines(fileName, getCharset());
            final FileContents contents = new FileContents(fileName, lines);
            final DetailAST rootAST = TreeWalker.parse(contents);
            walk(rootAST, contents);
        }
        catch (final FileNotFoundException fnfe) {
            Utils.getExceptionLogger()
View Full Code Here

     */
    public static DetailAST parseFile(String aFileName)
        throws IOException, ANTLRException
    {
        final String[] lines = Utils.getLines(aFileName);
        final FileContents contents = new FileContents(aFileName, lines);
        return TreeWalker.parse(contents);
    }
View Full Code Here

    @Override
    protected final void processAST(DetailAST aAST)
    {
        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

    }

    /** {@inheritDoc} */
    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,
View Full Code Here

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

            endLine = ((Integer[]) mCharacters.get(mMatcher.end() - 1))[0].
                    intValue();
            endColumn = ((Integer[]) mCharacters.get(mMatcher.end() - 1))[1].
                    intValue();
            if (mIgnoreComments) {
                final FileContents theFileContents = getFileContents();
                ignore = theFileContents.hasIntersectionWithComment(startLine,
                    startColumn, endLine, endColumn);
            }
            if (!ignore) {
                mMatchCount++;
                if (mIllegalPattern || (mCheckForDuplicates
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 beginTree(DetailAST aRootAST)
    {
        final FileContents contents = getFileContents();
        checkCppComments(contents);
        checkBadComments(contents);
    }
View Full Code Here

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

TOP

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

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.