Class FeaturesCollectorUtil

java.lang.Object
com.e1c.langtool.v8.dt.collector.FeaturesCollectorUtil

public class FeaturesCollectorUtil extends Object
The Class FeaturesCollectorUtil.
  • Constructor Details

    • FeaturesCollectorUtil

      public FeaturesCollectorUtil()
  • Method Details

    • collectFeatures

      public static void collectFeatures(org.eclipse.emf.ecore.EObject object, CollectingContext context, org.eclipse.core.runtime.IProgressMonitor monitor)
      Collect features from given object with checking that the string of each feature is "computed".
      Parameters:
      object - the object
      context - the context
      monitor - the monitor
    • getDefaultLanguageCode

      public static String getDefaultLanguageCode(org.eclipse.emf.ecore.EObject context, IV8ProjectManager projectManager)
    • appendWithPreffix

      public static void appendWithPreffix(Collection<FeatureValue> destanation, Collection<FeatureValue> source, FeatureKey preffix)
    • createFeatureValueBuilder

      @Deprecated public static V8FeatureValue.Builder createFeatureValueBuilder(ITranslationFeatureKeyProvider translationKeyProvider, String defaultLanguageCode, org.eclipse.emf.ecore.EObject object, org.eclipse.emf.common.util.URI objectUri, EFeatureSettings featureSettings, Collection<TranslateLanguage> languages)
      Deprecated.
    • getLocalStrings

      public static Map<String,String> getLocalStrings(org.eclipse.emf.ecore.EObject object, EFeatureSettings featureSettings, String defaultLanguageCode)
      Gets the map of local strings for all languages containing in the feature of the source object.
      Parameters:
      object - the source object, cannot be null.
      featureSettings - the feature settings, cannot be null.
      defaultLanguageCode - the default language code, cannot be null.
      Returns:
      the local strings, cannot return null.
    • getSourceValue

      public static String getSourceValue(org.eclipse.emf.ecore.EObject source, EFeatureSettings featureSettings, String defaultLanguageCode)
      Gets the source value from the EObject by its feature. If the feature is interface feature containing map of language code and interface strings this method returns value of the source language code if exist in map.
      Parameters:
      source - the source, cannot be null.
      featureSettings - the feature settings, cannot be null.
      defaultLanguageCode - the default language code, cannot be null.
      Returns:
      the source value, may return null.
    • fillLocalStrings

      public static void fillLocalStrings(V8FeatureValue.Builder builder, Map<String,String> localStrings, Collection<TranslateLanguage> languages)
      Fill local strings to the collecting FeatureValue, filtered with set of TranslateLanguage.
      Parameters:
      builder - the feature value builder
      localStrings - the local strings
      languages - the languages
    • fillLocalStrings

      public static void fillLocalStrings(FeatureValue fv, Map<String,String> localStrings, Collection<TranslateLanguage> languages)
      Fill local strings to the collecting FeatureValue, filtered with set of TranslateLanguage.
      Parameters:
      fv - the feature value
      localStrings - the local strings
      languages - the languages
    • fillLocalStrings

      public static void fillLocalStrings(Map<String,String> target, Map<String,String> localStrings, Collection<TranslateLanguage> languages)
      Fill local strings to the collecting FeatureValue, filtered with set of TranslateLanguage.
      Parameters:
      target - the target feature value local string map
      localStrings - the local strings
      languages - the languages
    • appendCollectedExternalProperties

      public static void appendCollectedExternalProperties(org.eclipse.emf.ecore.EObject object, CollectingContext context, org.eclipse.core.runtime.IProgressMonitor monitor)
      Append collected external properties.
      Parameters:
      object - the object with external properties.
      context - the collecting context
      monitor - the monitor
    • toFeatureKey

      public static FeatureKey toFeatureKey(String featureString)
      Creates a FeatureKey from string
      Parameters:
      featureString - the name, can be null
      Returns:
      the feature key, can be null