Class AbstractStringLiteralLinesProcessor

java.lang.Object
com.e1c.langtool.v8.dt.bsl.stringliteral.AbstractStringLiteralLinesProcessor
All Implemented Interfaces:
TypedStringLiteralContentProcessor
Direct Known Subclasses:
DcsParameterContentProcessor, EventContentProcessor, FullNameContentProcessor, KeysContentProcessor, MethodNameContentProcessor, ReplaceParamsContentProcessor

public abstract class AbstractStringLiteralLinesProcessor extends Object implements TypedStringLiteralContentProcessor
  • Constructor Details

    • AbstractStringLiteralLinesProcessor

      public AbstractStringLiteralLinesProcessor()
  • Method Details

    • getLineTranslation

      protected List<String> getLineTranslation(StringLiteral literal, List<String> content, Collection<LiteralType> types, IProjectTranslationProvider translationProvider, TranslateLanguage language, org.eclipse.xtext.util.CancelIndicator monitor)
      Gets the string literal lines translation from storages with hierarchy in current project.

      Note! If translation is not available, this method returns empty collection. Callers must check the result and cannot return empty list immediately to the processor.

      Call example:
         List newLines = getLineTranslation(literal, lines, types, translationProvider, language, monitor);
         if (newLines.isEmpty())
             return lines;
         return newLines;
       
      Parameters:
      literal - the literal, cannot be null.
      content - the content, cannot be null.
      types - the types, cannot be null.
      translationProvider - the translation provider, cannot be null.
      language - the language, cannot be null.
      monitor - the monitor, cannot be null.
      Returns:
      the translation of string literal lines, cannot return null.
    • createLinesTranslationKey

      protected ContextTranslationKey createLinesTranslationKey(StringLiteral literal, String sourceString)
    • getContextLineTranslation

      protected List<String> getContextLineTranslation(StringLiteral literal, List<String> content, Collection<LiteralType> types, IProjectTranslationProvider translationProvider, TranslateLanguage language, org.eclipse.xtext.util.CancelIndicator monitor)
    • isChangeDefaultLanguage

      protected boolean isChangeDefaultLanguage(IProjectTranslationProvider translationProvider)
    • isChangeScriptVariant

      protected boolean isChangeScriptVariant(IProjectTranslationProvider translationProvider)
    • fixKeyTranslationCase

      protected String fixKeyTranslationCase(String key, String translation)
      Fix key translation case if the source key is full upper or full lower case then translation changes to full upper or full lower case.
      Parameters:
      key - the source key, cannot be null.
      translation - the translation, cannot be null.
      Returns:
      the fixed translation string, cannot be null.
    • isStringLiteralLinesFullTranslationStoredPriority

      protected boolean isStringLiteralLinesFullTranslationStoredPriority(StringLiteral literal)