Package com.puppycrawl.tools.checkstyle.api

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


        final int len = mFiles.size();
        for (int i = 0; i < len; i++) {

            final String path = mFiles.get(i).getPath();
            getMessageCollector().reset();
            final MessageDispatcher dispatcher = getMessageDispatcher();
            dispatcher.fireFileStarted(path);

            for (int j = 0; j <= i; j++) {
                findDuplicatesInFiles(i, j);
            }

            fireErrors(path);
            dispatcher.fireFileFinished(path);
        }
    }
View Full Code Here


    {
        final Set<Entry<File, Set<Object>>> fls = aFileMap.entrySet();

        for (Entry<File, Set<Object>> entry : fls) {
            final File currentFile = entry.getKey();
            final MessageDispatcher dispatcher = getMessageDispatcher();
            final String path = currentFile.getPath();
            dispatcher.fireFileStarted(path);
            final Set<Object> currentKeys = entry.getValue();

            // Clone the keys so that they are not lost
            final Set<Object> keysClone = Sets.newHashSet(aKeys);
            keysClone.removeAll(currentKeys);

            // Remaining elements in the key set are missing in the current file
            if (!keysClone.isEmpty()) {
                for (Object key : keysClone) {
                    log(0, "translation.missingKey", key);
                }
            }
            fireErrors(path);
            dispatcher.fireFileFinished(path);
        }
    }
View Full Code Here

        final Set fls = aFileMap.entrySet();

        for (Iterator iter = fls.iterator(); iter.hasNext();) {
            final Map.Entry entry = (Map.Entry) iter.next();
            final File currentFile = (File) entry.getKey();
            final MessageDispatcher dispatcher = getMessageDispatcher();
            final String path = currentFile.getPath();
            dispatcher.fireFileStarted(path);
            final Set currentKeys = (Set) entry.getValue();

            // Clone the keys so that they are not lost
            final Set keysClone = new HashSet(aKeys);
            keysClone.removeAll(currentKeys);

            // Remaining elements in the key set are missing in the current file
            if (!keysClone.isEmpty()) {
                for (Iterator it = keysClone.iterator(); it.hasNext();) {
                    final Object key = it.next();
                    log(0, "translation.missingKey", key);
                }
            }
            fireErrors(path);
            dispatcher.fireFileFinished(path);
        }
    }
View Full Code Here

     * {@inheritDoc}
     */
    public void process(File[] aFiles)
    {
        final File[] files = filter(aFiles);
        final MessageDispatcher dispatcher = getMessageDispatcher();
        for (int i = 0; i < files.length; i++) {
            final File file = files[i];
            final String path = file.getPath();
            dispatcher.fireFileStarted(path);
            RandomAccessFile randomAccessFile = null;
            try {
                randomAccessFile = new RandomAccessFile(file, "r");
                if (!endsWithNewline(randomAccessFile)) {
                    log(0, "noNewlineAtEOF", path);
                }
            }
            catch (IOException e) {
                ///CLOVER:OFF
                logIOException(e);
                ///CLOVER:ON
            }
            finally {
                if (randomAccessFile != null) {
                    try {
                        randomAccessFile.close();
                    }
                    catch (IOException e) {
                        ///CLOVER:OFF
                        logIOException(e);
                        ///CLOVER:ON
                    }
                }
            }
            fireErrors(path);
            dispatcher.fireFileFinished(path);
        }
    }
View Full Code Here

        for (int i = 0; i < mFiles.length; i++) {

            final String path = mFiles[i].getPath();

            getMessageCollector().reset();
            final MessageDispatcher dispatcher = getMessageDispatcher();
            dispatcher.fireFileStarted(path);

            mLoc += mLineChecksums[i].length;
            for (int j = 0; j <= i; j++) {
                findDuplicatesInFiles(i, j);
            }

            fireErrors(path);
            dispatcher.fireFileFinished(path);
        }
    }
View Full Code Here

        final File[] javaFiles = filter(aFiles);
        final Set directories = getParentDirs(javaFiles);
        for (Iterator it = directories.iterator(); it.hasNext();) {
            final File dir = (File) it.next();
            final File packageHtml = new File(dir, "package.html");
            final MessageDispatcher dispatcher = getMessageDispatcher();
            final String path = packageHtml.getPath();
            dispatcher.fireFileStarted(path);
            if (!packageHtml.exists()) {
                log(0, "javadoc.packageHtml");
                fireErrors(path);
            }
            dispatcher.fireFileFinished(path);
        }
    }
View Full Code Here

TOP

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

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.