Class FolderDataPathPartTranslationProvider
java.lang.Object
com.e1c.langtool.v8.dt.translator.AbstractSplittedStringTranslationExistTranslationProvider
com.e1c.langtool.v8.dt.dcs.translator.FolderDataPathPartTranslationProvider
- All Implemented Interfaces:
IComputedNameProvider,IComputedStringFeatureProvider,IComputedStringFeatureTranslationProvider
public class FolderDataPathPartTranslationProvider
extends AbstractSplittedStringTranslationExistTranslationProvider
The translation provider allows to split
DataPath feature of DCS object with dot and translate them
as separate keys. The data-path is auto-computed string if all parts exit in the translation storage.-
Field Summary
Fields inherited from class com.e1c.langtool.v8.dt.translator.AbstractSplittedStringTranslationExistTranslationProvider
resourceLookup, SPLIT_REGEX_ALL, SPLIT_REGEX_DOT, storageManager, translatingProjectManager, translationFeatureKeyProvider -
Constructor Summary
ConstructorsConstructorDescriptionFolderDataPathPartTranslationProvider(ITranslatingProjectManager translatingProjectManager, IResourceLookup resourceLookup, ITranslationFeatureKeyProvider translationFeatureKeyProvider, ITranslationStorageManager storageManager) Instantiates a new folder data path part translation provider. -
Method Summary
Modifier and TypeMethodDescriptionprotected FeatureSettingsgetPartSettings(org.eclipse.emf.ecore.EObject object, EFeatureSettings stringFeature) Gets the part settings.protected StringGets the regular expression which should split string into parts.protected Set<FeatureSettings>Gets the supported features of the object that can be splited into parts.booleanisSupported(org.eclipse.emf.ecore.EObject object) Checks if givenEObjectis supported by this provider.protected booleanisValidPart(String part, org.eclipse.emf.ecore.EObject object, String value) Checks if the part is valid for the feature.Methods inherited from class com.e1c.langtool.v8.dt.translator.AbstractSplittedStringTranslationExistTranslationProvider
computeTranslatedString, isComputedString
-
Constructor Details
-
FolderDataPathPartTranslationProvider
@Inject public FolderDataPathPartTranslationProvider(ITranslatingProjectManager translatingProjectManager, IResourceLookup resourceLookup, ITranslationFeatureKeyProvider translationFeatureKeyProvider, ITranslationStorageManager storageManager) Instantiates a new folder data path part translation provider.- Parameters:
translatingProjectManager- the translating project manager service, cannot benull.resourceLookup- the resource lookup service, cannot benull.translationFeatureKeyProvider- the translation feature key provider service, cannot benull.storageManager- the storage manager service, cannot benull.
-
-
Method Details
-
isSupported
public boolean isSupported(org.eclipse.emf.ecore.EObject object) Description copied from interface:IComputedNameProviderChecks if givenEObjectis supported by this provider.- Parameters:
object- the object- Returns:
- true, if it is supported
-
getSplitRegex
Description copied from class:AbstractSplittedStringTranslationExistTranslationProviderGets the regular expression which should split string into parts.- Specified by:
getSplitRegexin classAbstractSplittedStringTranslationExistTranslationProvider- Returns:
- the split regular expression, cannot return
null.
-
getSupportedFeatures
Description copied from class:AbstractSplittedStringTranslationExistTranslationProviderGets the supported features of the object that can be splited into parts.- Specified by:
getSupportedFeaturesin classAbstractSplittedStringTranslationExistTranslationProvider- Returns:
- the supported features, cannot return
null.
-
getPartSettings
protected FeatureSettings getPartSettings(org.eclipse.emf.ecore.EObject object, EFeatureSettings stringFeature) Description copied from class:AbstractSplittedStringTranslationExistTranslationProviderGets the part settings. Default isNAMED_ELEMENT__NAME. Clients may override this settings according they split the string feature.- Overrides:
getPartSettingsin classAbstractSplittedStringTranslationExistTranslationProvider- Parameters:
object- the object , cannot benull.stringFeature- the string feature, cannot benull.- Returns:
- the part settings, cannot return
null.
-
isValidPart
Description copied from class:AbstractSplittedStringTranslationExistTranslationProviderChecks if the part is valid for the feature.- Specified by:
isValidPartin classAbstractSplittedStringTranslationExistTranslationProvider- Parameters:
part- the partobject- the objectvalue- the value- Returns:
- true, if is valid part
-