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 a
LanguageModuleBase.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
ConstructorsModifierConstructorDescriptionprotectedprotectedSimpleDialectLanguageModuleBase(LanguageModuleBase.DialectLanguageMetadata metadata, Function<LanguagePropertyBundle, BasePmdDialectLanguageVersionHandler> makeHandler) protectedSimpleDialectLanguageModuleBase(LanguageModuleBase.DialectLanguageMetadata metadata, BasePmdDialectLanguageVersionHandler handler) -
Method Summary
Modifier and TypeMethodDescriptioncreateCpdLexer(LanguagePropertyBundle bundle) Create a newCpdLexerfor this language, given a property bundle with configuration.final LanguageProcessorCreate a newLanguageProcessorfor this language, given a property bundle with configuration.protected @NonNull LanguagePropertyBundlefinal LanguagePropertyBundleCreates 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, 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
-
Constructor Details
-
SimpleDialectLanguageModuleBase
-
SimpleDialectLanguageModuleBase
protected SimpleDialectLanguageModuleBase(LanguageModuleBase.DialectLanguageMetadata metadata, BasePmdDialectLanguageVersionHandler handler) -
SimpleDialectLanguageModuleBase
protected SimpleDialectLanguageModuleBase(LanguageModuleBase.DialectLanguageMetadata metadata, Function<LanguagePropertyBundle, BasePmdDialectLanguageVersionHandler> makeHandler)
-
-
Method Details
-
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:
newPropertyBundlein interfaceLanguage- Returns:
- A new set of properties
-
newDialectPropertyBundle
-
createProcessor
Description copied from interface:PmdCapableLanguageCreate a newLanguageProcessorfor 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:
createProcessorin interfacePmdCapableLanguage- Parameters:
bundle- A bundle of properties created by this instance.- Returns:
- A new language processor
-
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
-