Class DcsNStrUtil

java.lang.Object
com.e1c.langtool.v8.dt.internal.dcs.i18n.DcsNStrUtil

public class DcsNStrUtil extends Object
Contain utility methods to process DCS Expressions with embedded NStr's.
  • Method Details

    • canContainNStr

      public static boolean canContainNStr(String value)
    • isExpressionWithNStr

      public static boolean isExpressionWithNStr(String value, QName elementName)
    • processExpressionWithNStr

      public static String processExpressionWithNStr(FeatureKey fieldFeatureKey, String expression, BiFunction<FeatureKey,String,String> processor)
    • formatNStr

      public static String formatNStr(Map<String,String> strings)
      Format NStr string from given map. Apostrophe ' symbols inside string escaped with doubling. Quotation mark " escaping should be done separately. Currently handled in {@link DcsNStrUtil.processExpressionWithNStr(FeatureKey, String, BiFunction<FeatureKey, String, String>)}
      Parameters:
      strings - Map <language code> ⇒ <localized message>.
      Returns:
      Formatted NStr content (without outer quotes
    • buildNStrContextTranslationKey

      public static ContextTranslationKey buildNStrContextTranslationKey(org.eclipse.core.resources.IFile file, org.eclipse.emf.common.util.URI fileURI, FeatureKey featureKey, String sourceString)