Class 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.
  • Field Details

  • Constructor Details

    • AbstractTranslationValidator

      public AbstractTranslationValidator()
  • Method Details

    • configureCheck

      protected void configureCheck(BasicCheck.CheckConfigurer builder)
      Description copied from class: BasicCheck
      The 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 of EClass'es and their features those changes are being tracked/or be targets of the validation
      Specified by:
      configureCheck in class BasicCheck<AbstractTranslationValidator.TranslationValidatorContext>
    • prepareContext

      public AbstractTranslationValidator.TranslationValidatorContext prepareContext(Object object, ICheckParameters parameters, org.eclipse.core.runtime.IProgressMonitor progressMonitor)
      Description copied from interface: ICheck
      Prepares 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 be null
      parameters - check execution parameters from settings, not null
      progressMonitor - progress monitor, not null
      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 project
      featureValue - the feature value
      language - the language
      object - the object
      resultAcceptor - the message acceptor
      parameters - 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 object
      resultAcceptor - the message acceptor
      value - the value
      key - the key
      featureSettings -
      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

      protected IProjectTranslationReader getReader(org.eclipse.core.resources.IProject project)