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.LanguageMetadataneeds 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 protectedSimpleDialectLanguageModuleBase(LanguageModuleBase.DialectLanguageMetadata metadata)protectedSimpleDialectLanguageModuleBase(LanguageModuleBase.DialectLanguageMetadata metadata, Function<LanguagePropertyBundle,BasePmdDialectLanguageVersionHandler> makeHandler)protectedSimpleDialectLanguageModuleBase(LanguageModuleBase.DialectLanguageMetadata metadata, BasePmdDialectLanguageVersionHandler handler)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CpdLexercreateCpdLexer(LanguagePropertyBundle bundle)Create a newCpdLexerfor this language, given a property bundle with configuration.LanguageProcessorcreateProcessor(LanguagePropertyBundle bundle)Create a newLanguageProcessorfor this language, given a property bundle with configuration.protected @NonNull LanguagePropertyBundlenewDialectPropertyBundle()LanguagePropertyBundlenewPropertyBundle()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:
newPropertyBundlein interfaceLanguage- Returns:
- A new set of properties
-
newDialectPropertyBundle
protected @NonNull LanguagePropertyBundle newDialectPropertyBundle()
-
createProcessor
public final LanguageProcessor createProcessor(LanguagePropertyBundle bundle)
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
public CpdLexer createCpdLexer(LanguagePropertyBundle bundle)
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
-
-