Package com.e1c.langtool.v8.dt.collector
Class FeaturesCollectorUtil
java.lang.Object
com.e1c.langtool.v8.dt.collector.FeaturesCollectorUtil
The Class FeaturesCollectorUtil.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidappendCollectedExternalProperties(org.eclipse.emf.ecore.EObject object, CollectingContext context, org.eclipse.core.runtime.IProgressMonitor monitor) Append collected external properties.static voidappendWithPreffix(Collection<FeatureValue> destanation, Collection<FeatureValue> source, FeatureKey preffix) static voidcollectFeatures(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".static V8FeatureValue.BuildercreateFeatureValueBuilder(ITranslationFeatureKeyProvider translationKeyProvider, String defaultLanguageCode, org.eclipse.emf.ecore.EObject object, org.eclipse.emf.common.util.URI objectUri, EFeatureSettings featureSettings, Collection<TranslateLanguage> languages) Deprecated.static voidfillLocalStrings(FeatureValue fv, Map<String, String> localStrings, Collection<TranslateLanguage> languages) Fill local strings to the collectingFeatureValue, filtered with set ofTranslateLanguage.static voidfillLocalStrings(V8FeatureValue.Builder builder, Map<String, String> localStrings, Collection<TranslateLanguage> languages) Fill local strings to the collectingFeatureValue, filtered with set ofTranslateLanguage.static voidfillLocalStrings(Map<String, String> target, Map<String, String> localStrings, Collection<TranslateLanguage> languages) Fill local strings to the collectingFeatureValue, filtered with set ofTranslateLanguage.static StringgetDefaultLanguageCode(org.eclipse.emf.ecore.EObject context, IV8ProjectManager projectManager) getLocalStrings(org.eclipse.emf.ecore.EObject object, EFeatureSettings featureSettings, String defaultLanguageCode) Gets the map of local strings for all languages containing in thefeatureof the source object.static StringgetSourceValue(org.eclipse.emf.ecore.EObject source, EFeatureSettings featureSettings, String defaultLanguageCode) Gets the source value from theEObjectby itsfeature.static FeatureKeytoFeatureKey(String featureString) Creates aFeatureKeyfrom string
-
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 objectcontext- the contextmonitor- 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 thefeatureof the source object.- Parameters:
object- the source object, cannot benull.featureSettings- the feature settings, cannot benull.defaultLanguageCode- the default language code, cannot benull.- 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 theEObjectby itsfeature. 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 benull.featureSettings- the feature settings, cannot benull.defaultLanguageCode- the default language code, cannot benull.- 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 collectingFeatureValue, filtered with set ofTranslateLanguage.- Parameters:
builder- the feature value builderlocalStrings- the local stringslanguages- the languages
-
fillLocalStrings
public static void fillLocalStrings(FeatureValue fv, Map<String, String> localStrings, Collection<TranslateLanguage> languages) Fill local strings to the collectingFeatureValue, filtered with set ofTranslateLanguage.- Parameters:
fv- the feature valuelocalStrings- the local stringslanguages- the languages
-
fillLocalStrings
public static void fillLocalStrings(Map<String, String> target, Map<String, String> localStrings, Collection<TranslateLanguage> languages) Fill local strings to the collectingFeatureValue, filtered with set ofTranslateLanguage.- Parameters:
target- the target feature value local string maplocalStrings- the local stringslanguages- 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 contextmonitor- the monitor
-
toFeatureKey
Creates aFeatureKeyfrom string- Parameters:
featureString- the name, can benull- Returns:
- the feature key, can be
null
-