Package net.sourceforge.pmd.lang.impl
Class BatchLanguageProcessor<P extends LanguagePropertyBundle>
- java.lang.Object
-
- net.sourceforge.pmd.lang.impl.BatchLanguageProcessor<P>
-
- All Implemented Interfaces:
AutoCloseable
,LanguageProcessor
public abstract class BatchLanguageProcessor<P extends LanguagePropertyBundle> extends Object implements LanguageProcessor
A base class for language processors. It processes all files of the corresponding language as a single batch. It can operate in parallel or sequentially depending on the number of threads passed in theLanguageProcessor.AnalysisTask
.- Author:
- Clément Fournier
- Since:
- 7.0.0
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface net.sourceforge.pmd.lang.LanguageProcessor
LanguageProcessor.AnalysisTask
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
BatchLanguageProcessor(P bundle)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
@NonNull PmdCapableLanguage
getLanguage()
The language of this processor.@NonNull LanguageVersion
getLanguageVersion()
The language version that was configured when creating this processor.P
getProperties()
@NonNull AutoCloseable
launchAnalysis(@NonNull LanguageProcessor.AnalysisTask task)
Launch the analysis based on the givenanalysis task
.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface net.sourceforge.pmd.lang.LanguageProcessor
services
-
-
-
-
Constructor Detail
-
BatchLanguageProcessor
protected BatchLanguageProcessor(P bundle)
-
-
Method Detail
-
getProperties
public P getProperties()
-
getLanguageVersion
public @NonNull LanguageVersion getLanguageVersion()
Description copied from interface:LanguageProcessor
The language version that was configured when creating this processor.- Specified by:
getLanguageVersion
in interfaceLanguageProcessor
-
getLanguage
public final @NonNull PmdCapableLanguage getLanguage()
Description copied from interface:LanguageProcessor
The language of this processor.- Specified by:
getLanguage
in interfaceLanguageProcessor
-
launchAnalysis
public @NonNull AutoCloseable launchAnalysis(@NonNull LanguageProcessor.AnalysisTask task)
Description copied from interface:LanguageProcessor
Launch the analysis based on the givenanalysis task
. The analysis only has to completion after the return value has been closed, as this method may launch background threads to perform the analysis and return without blocking. In that case the returned Closeable will join the analysis threads when being closed.- Specified by:
launchAnalysis
in interfaceLanguageProcessor
- Parameters:
task
- Configuration of the analysis- Returns:
- A closeable - the analysis is only ended when the close method returns.
-
close
public void close() throws Exception
- Specified by:
close
in interfaceAutoCloseable
- Throws:
Exception
-
-