Class PlainTextLanguage

All Implemented Interfaces:
Comparable<Language>, CpdCapableLanguage, Language, PmdCapableLanguage

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 by LanguageRegistry and can only be used explicitly with getInstance().
Author:
Clément Fournier
Since:
6.48.0
  • Method Details

    • getInstance

      public static PlainTextLanguage getInstance()
      Returns the singleton instance of this language.
    • createCpdLexer

      public CpdLexer createCpdLexer(LanguagePropertyBundle bundle)
      Description copied from interface: CpdCapableLanguage
      Create a new CpdLexer for this language, given a property bundle with configuration. The bundle was created by this instance using Language.newPropertyBundle(). It can be assumed that the bundle will never be mutated anymore, and this method takes ownership of it.
      Specified by:
      createCpdLexer in interface CpdCapableLanguage
      Parameters:
      bundle - A bundle of properties created by this instance.
      Returns:
      A new language processor