Package net.sourceforge.pmd.lang.impl
Class SimpleDialectLanguageModuleBase
- java.lang.Object
-
- net.sourceforge.pmd.lang.LanguageModuleBase
-
- net.sourceforge.pmd.lang.impl.SimpleDialectLanguageModuleBase
-
- All Implemented Interfaces:
Comparable<Language>
,CpdCapableLanguage
,Language
,PmdCapableLanguage
@Experimental public class SimpleDialectLanguageModuleBase extends LanguageModuleBase implements PmdCapableLanguage, CpdCapableLanguage
The simplest implementation of a dialect, where only aLanguageModuleBase.LanguageMetadata
needs to be implemented. Everything gets delegated to the base language, with all dialect extension applied.- Author:
- Juan MartÃn Sotuyo Dodero
- Experimental Status:
- Since 7.13.0. See [core] Support language dialects #5438.
- Since:
- 7.13.0
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class net.sourceforge.pmd.lang.LanguageModuleBase
LanguageModuleBase.DialectLanguageMetadata, LanguageModuleBase.LanguageMetadata
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
SimpleDialectLanguageModuleBase(LanguageModuleBase.DialectLanguageMetadata metadata)
protected
SimpleDialectLanguageModuleBase(LanguageModuleBase.DialectLanguageMetadata metadata, Function<LanguagePropertyBundle,BasePmdDialectLanguageVersionHandler> makeHandler)
protected
SimpleDialectLanguageModuleBase(LanguageModuleBase.DialectLanguageMetadata metadata, BasePmdDialectLanguageVersionHandler handler)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CpdLexer
createCpdLexer(LanguagePropertyBundle bundle)
Create a newCpdLexer
for this language, given a property bundle with configuration.LanguageProcessor
createProcessor(LanguagePropertyBundle bundle)
Create a newLanguageProcessor
for this language, given a property bundle with configuration.protected @NonNull LanguagePropertyBundle
newDialectPropertyBundle()
LanguagePropertyBundle
newPropertyBundle()
Creates a combined property bundle with all properties from the dialect and the base language.-
Methods inherited from class net.sourceforge.pmd.lang.LanguageModuleBase
compareTo, equals, getBaseLanguageId, getDefaultVersion, getDependencies, getExtensions, getId, getName, getShortName, 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
getBaseLanguageId, getDefaultVersion, getDependencies, getExtensions, getId, getLatestVersion, getName, getShortName, getVersion, getVersionNamesAndAliases, getVersions, hasExtension, hasVersion, isDialectOf
-
-
-
-
Constructor Detail
-
SimpleDialectLanguageModuleBase
protected SimpleDialectLanguageModuleBase(LanguageModuleBase.DialectLanguageMetadata metadata)
-
SimpleDialectLanguageModuleBase
protected SimpleDialectLanguageModuleBase(LanguageModuleBase.DialectLanguageMetadata metadata, BasePmdDialectLanguageVersionHandler handler)
-
SimpleDialectLanguageModuleBase
protected SimpleDialectLanguageModuleBase(LanguageModuleBase.DialectLanguageMetadata metadata, Function<LanguagePropertyBundle,BasePmdDialectLanguageVersionHandler> makeHandler)
-
-
Method Detail
-
newPropertyBundle
public final LanguagePropertyBundle newPropertyBundle()
Creates a combined property bundle with all properties from the dialect and the base language. To define dialect-specific properties to be added to this bundle, overridenewDialectPropertyBundle()
- Specified by:
newPropertyBundle
in interfaceLanguage
- Returns:
- A new set of properties
-
newDialectPropertyBundle
protected @NonNull LanguagePropertyBundle newDialectPropertyBundle()
-
createProcessor
public final LanguageProcessor createProcessor(LanguagePropertyBundle bundle)
Description copied from interface:PmdCapableLanguage
Create a newLanguageProcessor
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:
createProcessor
in interfacePmdCapableLanguage
- Parameters:
bundle
- A bundle of properties created by this instance.- Returns:
- A new language processor
-
createCpdLexer
public CpdLexer createCpdLexer(LanguagePropertyBundle bundle)
Description copied from interface:CpdCapableLanguage
Create a newCpdLexer
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:
createCpdLexer
in interfaceCpdCapableLanguage
- Parameters:
bundle
- A bundle of properties created by this instance.- Returns:
- A new language processor
-
-