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
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 by
LanguageRegistry
and can only be used explicitly with getInstance().- Author:
- Clément Fournier
- Since:
- 6.48.0
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classThe only node produced by the parser ofPlainTextLanguage.Nested classes/interfaces inherited from class net.sourceforge.pmd.lang.LanguageModuleBase
LanguageModuleBase.DialectLanguageMetadata, LanguageModuleBase.LanguageMetadata -
Method Summary
Modifier and TypeMethodDescriptioncreateCpdLexer(LanguagePropertyBundle bundle) Create a newCpdLexerfor this language, given a property bundle with configuration.static PlainTextLanguageReturns the singleton instance of this language.Methods inherited from class net.sourceforge.pmd.lang.impl.SimpleLanguageModuleBase
createProcessorMethods inherited from class net.sourceforge.pmd.lang.LanguageModuleBase
compareTo, equals, getBaseLanguageId, getDefaultVersion, getDependencies, getExtensions, getId, getName, getShortName, getVersion, getVersionNamesAndAliases, getVersions, hashCode, toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.Comparable
compareToMethods inherited from interface net.sourceforge.pmd.lang.Language
getBaseLanguageId, getDefaultVersion, getDependencies, getExtensions, getId, getLatestVersion, getName, getShortName, getVersion, getVersionNamesAndAliases, getVersions, hasExtension, hasVersion, isDialectOf, newPropertyBundle
-
Method Details
-
getInstance
Returns the singleton instance of this language. -
createCpdLexer
Description copied from interface:CpdCapableLanguageCreate a newCpdLexerfor 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:
createCpdLexerin interfaceCpdCapableLanguage- Parameters:
bundle- A bundle of properties created by this instance.- Returns:
- A new language processor
-