Package com.puppycrawl.tools.checkstyle.api

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


        for (final File f : aFiles) {
            final String fileName = f.getAbsolutePath();
            fireFileStarted(fileName);
            final SortedSet<LocalizedMessage> fileMessages = Sets.newTreeSet();
            try {
                final FileText theText = new FileText(f.getAbsoluteFile(),
                        mCharset);
                for (final FileSetCheck fsc : mFileSetChecks) {
                    fileMessages.addAll(fsc.process(f, theText));
                }
            }
View Full Code Here


        final String[] cachedLines = mTrimmedLineCache.get(path);
        if (cachedLines != null) {
            return cachedLines;
        }
        final String charset = mCharset;
        final FileText text = new FileText(aFile, charset);
        final String[] lines = getTrimmed(text.toLinesArray());
        mTrimmedLineCache.put(path, lines);
        return lines;
    }
View Full Code Here

    public void openFile(File aFile, final Component aParent)
    {
        if (aFile != null) {
            try {
                Main.frame.setTitle("Checkstyle : " + aFile.getName());
                final FileText text = new FileText(aFile.getAbsoluteFile(),
                                                   getEncoding());
                final DetailAST parseTree = parseFile(text);
                mParseTreeModel.setParseTree(parseTree);
                mCurrentFile = aFile;
                mLastDirectory = aFile.getParentFile();
                reloadAction.setEnabled(true);

                final String[] sourceLines = text.toLinesArray();

                // clear for each new file
                 getLines2position().clear();
                 // starts line counting at 1
                 getLines2position().add(0);
View Full Code Here

     */
    @Deprecated
    public static DetailAST parseFile(String aFileName)
        throws IOException, ANTLRException
    {
        return parseFile(new FileText(new File(aFileName), getEncoding()));
    }
View Full Code Here

        if (mCache.alreadyChecked(fileName, timestamp)) {
            return;
        }

        try {
            final FileText text = FileText.fromLines(aFile, aLines);
            final FileContents contents = new FileContents(text);
            final DetailAST rootAST = TreeWalker.parse(contents);

            getMessageCollector().reset();
View Full Code Here

    protected void handleViolation(int aLineno, String aLine, int startCol) {
      violations.add( aLineno );
    }

    private FileContents content(List<String> aLines) {
      FileText fileText = FileText.fromLines( new File( "" ), aLines );
      return new FileContents( fileText );
    }
View Full Code Here

    suppressor.setCurrentContents( content( "System.out.println   (\"text text\");" ) );
    Assert.assertFalse( suppressor.shouldSuppress( 1, 18, 0, 20 ) );
  }

  private FileContents content(String string) {
    FileText fileText = FileText.fromLines( new File( "" ), Arrays.asList( string ) );
    return new FileContents( fileText );
  }
View Full Code Here

TOP

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

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.