Package net.sourceforge.pmd.lang
Class PlainTextLanguage
- java.lang.Object
-
- net.sourceforge.pmd.lang.LanguageModuleBase
-
- net.sourceforge.pmd.lang.impl.SimpleLanguageModuleBase
-
- net.sourceforge.pmd.lang.PlainTextLanguage
-
- All Implemented Interfaces:
Comparable<Language>
,CpdCapableLanguage
,Language
,PmdCapableLanguage
@Experimental public final class PlainTextLanguage extends SimpleLanguageModuleBase implements CpdCapableLanguage
A dummy language implementation whose parser produces a single node. This is provided for cases where a non-null language is required, but the parser is not useful. This is useful eg to mock rules when no other language is on the classpath. This language is not exposed byLanguageRegistry
and can only be used explicitly withgetInstance()
.- Since:
- 6.48.0
- Author:
- Clément Fournier
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
PlainTextLanguage.PlainTextFile
The only node produced by the parser ofPlainTextLanguage
.-
Nested classes/interfaces inherited from class net.sourceforge.pmd.lang.LanguageModuleBase
LanguageModuleBase.LanguageMetadata
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Tokenizer
createCpdTokenizer(LanguagePropertyBundle bundle)
Create a newTokenizer
for this language, given a property bundle with configuration.static PlainTextLanguage
getInstance()
Returns the singleton instance of this language.-
Methods inherited from class net.sourceforge.pmd.lang.impl.SimpleLanguageModuleBase
createProcessor
-
Methods inherited from class net.sourceforge.pmd.lang.LanguageModuleBase
compareTo, equals, getDefaultVersion, getDependencies, getExtensions, getName, getShortName, getTerseName, getVersion, getVersionNamesAndAliases, getVersions, hashCode, toString
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.lang.Comparable
compareTo
-
Methods inherited from interface net.sourceforge.pmd.lang.Language
getDefaultVersion, getDependencies, getExtensions, getId, getLatestVersion, getName, getShortName, getTerseName, getVersion, getVersionNamesAndAliases, getVersions, hasExtension, hasVersion, newPropertyBundle
-
-
-
-
Method Detail
-
getInstance
public static PlainTextLanguage getInstance()
Returns the singleton instance of this language.
-
createCpdTokenizer
public Tokenizer createCpdTokenizer(LanguagePropertyBundle bundle)
Description copied from interface:CpdCapableLanguage
Create a newTokenizer
for this language, given a property bundle with configuration. The bundle was created by this instance usingLanguage.newPropertyBundle()
. It can be assumed that the bundle will never be mutated anymore, and this method takes ownership of it.- Specified by:
createCpdTokenizer
in interfaceCpdCapableLanguage
- Parameters:
bundle
- A bundle of properties created by this instance.- Returns:
- A new language processor
-
-