Package com.e1c.langtool.v8.dt.check
Class AbstractTranslationValidator
java.lang.Object
com.e1c.g5.v8.dt.check.components.BasicCheck<AbstractTranslationValidator.TranslationValidatorContext>
com.e1c.langtool.v8.dt.check.AbstractTranslationValidator
- All Implemented Interfaces:
ITopObjectFilter,ICheck<AbstractTranslationValidator.TranslationValidatorContext>
- Direct Known Subclasses:
DcsModelTranslationCheck,DynamicFeatureAccessTranslationCheck,MethodTranslationValidator,NotAllowedTranslationCheck,NstrLiteralPramTranslationCheck,NstrLiteralValidator,PresentationTranslationCheck,RegionTranslationValidator,StringLiteralKeysTranslationValidator,StringLiteralValidator,StructureKeysTranslationValidator,TableKeysTranslationValidator,VariableTranslationValidator
public abstract class AbstractTranslationValidator
extends BasicCheck<AbstractTranslationValidator.TranslationValidatorContext>
The abstract validator class to check translations for
EObject features.
It collects model feature values and get translation from each ITranslationStorageProvider.Storage of project.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclassStandard context for translation validators
Contains useful data and services that are required by validators to speed up the processNested classes/interfaces inherited from class com.e1c.g5.v8.dt.check.components.BasicCheck
BasicCheck.CheckConfigurer, BasicCheck.CheckParameterBuilder, BasicCheck.ContainmentConfigurationBuilder, BasicCheck.DelegateCheckConfigurationBuilder, BasicCheck.ModuleConfigurationBuilder, BasicCheck.ResultAcceptor, BasicCheck.TopObjectConfigurationBuilder, BasicCheck.TopObjectFeatureConfigurationBuilder -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected IFeatureValueCollectingServiceprotected IComputedNameServiceprotected ITranslationFeatureKeyProviderprotected ITranslatingProjectManagerprotected IResourceLookupprotected IFeatureSettingsServiceprotected IStorageSettingsManagerprotected IV8ProjectManager -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddNoTranslationMessage(org.eclipse.emf.ecore.EObject object, BasicCheck.ResultAcceptor resultAcceptor, String value, FeatureKey key, FeatureSettings featureSettings, Collection<String> languages) Adds the message about empty translation for specific languages.protected voidcheckTranslation(org.eclipse.emf.ecore.EObject object, BasicCheck.ResultAcceptor resultAcceptor, ICheckParameters parameters, org.eclipse.core.runtime.IProgressMonitor monitor) protected voidconfigureCheck(BasicCheck.CheckConfigurer builder) The check is performed in case of changes of the tracjed object model/language module changes.protected org.eclipse.emf.ecore.EStructuralFeaturegetMessageFeature(FeatureSettings featureSettings) protected ICollectingParametersgetParameters(org.eclipse.core.resources.IProject project, ICheckParameters parameters) protected IProjectTranslationReadergetReader(org.eclipse.core.resources.IProject project) protected StringgetTranslation(org.eclipse.core.resources.IProject project, FeatureValue featureValue, TranslateLanguage language, org.eclipse.emf.ecore.EObject object, BasicCheck.ResultAcceptor resultAcceptor, ICheckParameters parameters) Gets the translation.prepareContext(Object object, ICheckParameters parameters, org.eclipse.core.runtime.IProgressMonitor progressMonitor) Prepares context of the check if applicable.Methods inherited from class com.e1c.g5.v8.dt.check.components.BasicCheck
check, check, check, configureContextCollector, isCheckApplicable, postConfigureContextCollectorMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.e1c.g5.v8.dt.check.ICheck
check, getCheckId, prepareContext
-
Field Details
-
resourceLookup
-
storageSettingsManager
-
collectingService
-
settingsService
-
featureKeyProvider
-
computedNameService
-
v8ProjectManager
-
projectManager
-
-
Constructor Details
-
AbstractTranslationValidator
public AbstractTranslationValidator()
-
-
Method Details
-
configureCheck
Description copied from class:BasicCheckThe check is performed in case of changes of the tracjed object model/language module changes. In order to define the rules of the check performing, the developer should define the set ofEClass'es and their features those changes are being tracked/or be targets of the validation- Specified by:
configureCheckin classBasicCheck<AbstractTranslationValidator.TranslationValidatorContext>
-
prepareContext
public AbstractTranslationValidator.TranslationValidatorContext prepareContext(Object object, ICheckParameters parameters, org.eclipse.core.runtime.IProgressMonitor progressMonitor) Description copied from interface:ICheckPrepares context of the check if applicable. Context may be used to provide commonly used data and facilities, as well as collect data during subsequent calls of the check on the same data subtree- Parameters:
object- The initial object for the check. Usually is a top BM object or top object in the resource. May not benullparameters- check execution parameters from settings, notnullprogressMonitor- progress monitor, notnull- Returns:
- Context if any. May be
null
-
checkTranslation
protected void checkTranslation(org.eclipse.emf.ecore.EObject object, BasicCheck.ResultAcceptor resultAcceptor, ICheckParameters parameters, org.eclipse.core.runtime.IProgressMonitor monitor) -
getTranslation
protected String getTranslation(org.eclipse.core.resources.IProject project, FeatureValue featureValue, TranslateLanguage language, org.eclipse.emf.ecore.EObject object, BasicCheck.ResultAcceptor resultAcceptor, ICheckParameters parameters) Gets the translation.- Parameters:
project- the projectfeatureValue- the feature valuelanguage- the languageobject- the objectresultAcceptor- the message acceptorparameters- the parameters- Returns:
- the translation
-
addNoTranslationMessage
protected void addNoTranslationMessage(org.eclipse.emf.ecore.EObject object, BasicCheck.ResultAcceptor resultAcceptor, String value, FeatureKey key, FeatureSettings featureSettings, Collection<String> languages) Adds the message about empty translation for specific languages.- Parameters:
object- the objectresultAcceptor- the message acceptorvalue- the valuekey- the keyfeatureSettings-languages- the languages without translation
-
getMessageFeature
protected org.eclipse.emf.ecore.EStructuralFeature getMessageFeature(FeatureSettings featureSettings) -
getParameters
protected ICollectingParameters getParameters(org.eclipse.core.resources.IProject project, ICheckParameters parameters) -
getReader
-