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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected ContextTranslationKeycreateLinesTranslationKey(StringLiteral literal, String sourceString) protected StringfixKeyTranslationCase(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.getContextLineTranslation(StringLiteral literal, List<String> content, Collection<LiteralType> types, IProjectTranslationProvider translationProvider, TranslateLanguage language, org.eclipse.xtext.util.CancelIndicator monitor) 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.protected booleanisChangeDefaultLanguage(IProjectTranslationProvider translationProvider) protected booleanisChangeScriptVariant(IProjectTranslationProvider translationProvider) protected booleanMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.e1c.langtool.v8.dt.bsl.stringliteral.TypedStringLiteralContentProcessor
isSupport, process
-
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 benull.content- the content, cannot benull.types- the types, cannot benull.translationProvider- the translation provider, cannot benull.language- the language, cannot benull.monitor- the monitor, cannot benull.- 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
-
isChangeScriptVariant
-
fixKeyTranslationCase
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 benull.translation- the translation, cannot benull.- Returns:
- the fixed translation string, cannot be
null.
-
isStringLiteralLinesFullTranslationStoredPriority
-