Package org.infernus.idea.checkstyle.checker

Examples of org.infernus.idea.checkstyle.checker.CheckerContainer


                                         final CheckStylePlugin checkStylePlugin,
                                         final Module module)
            throws IOException {
        ScannableFile scannableFile = null;
        try {
            final CheckerContainer checkerContainer = getChecker(checkStylePlugin, module);
            final Configuration config = getConfig(checkStylePlugin, module);
            if (checkerContainer == null || config == null) {
                return new ProblemDescriptor[0];
            }

            final List<Check> checks = CheckFactory.getChecks(config);

            final Document fileDocument = PsiDocumentManager.getInstance(
                    manager.getProject()).getDocument(psiFile);
            if (fileDocument == null) {
                LOG.debug("Skipping check - file is binary or has no document: " + psiFile.getName());
                return null;
            }

            scannableFile = new ScannableFile(psiFile, module);

            final Map<String, PsiFile> filesToScan = Collections.singletonMap(scannableFile.getAbsolutePath(), psiFile);

            final boolean suppressingErrors = checkStylePlugin.getConfiguration().isSuppressingErrors();
            final CheckStyleAuditListener listener = new CheckStyleAuditListener(
                    filesToScan, manager, false, suppressingErrors, checkerContainer.getTabWidth(), checks);
            final Checker checker = checkerContainer.getChecker();
            synchronized (checker) {
                checker.addListener(listener);
                checker.process(Arrays.asList(scannableFile.getFile()));
                checker.removeListener(listener);
            }
View Full Code Here

TOP

Related Classes of org.infernus.idea.checkstyle.checker.CheckerContainer

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.