Interface IConverterManager

All Known Implementing Classes:
ConverterManagerImpl, EmptyConverterManager

public interface IConverterManager
Manager responsible for coordinating the conversion process between language projects. This manager is part of the conversion framework and provides methods to control and monitor the conversion activities.

Usage example:


 // Obtain the IConverterManager from a IConverterService
 IConverterService converterService = ...; // Obtain the instance through dependency injection or other means
 IProject project = ...; //Specify the translated project
 IProject sourceProject = ...; // Specify the source language project
 IProject targetProject = ...; // Specify the target language project
 IConverterManager manager = converterService.getManager(project);

 // Run the converter to convert the source language project to the target language project
 manager.runConverter(sourceProject, targetProject);

 // Access and manipulate conversion data
 IPath path = ...; // Specify the path for conversion
 IPath convertedKey = manager.getConvertedKey(path);
 manager.updateKeyToConvert(path, convertedKey);
 manager.removeKeyToConvert(path);
 Map<String, String> convertedValues = manager.getConvertedValues(path);
 FeatureKey sourceKey = ...; // Specify the source key for conversion
 FeatureKey targetKey = ...; // Specify the target key for conversion
 manager.updateValuesToConvert(path, sourceKey, targetKey);
 manager.removeValuesToConvert(path);

 // Remove the conversion data for the specified path
 manager.remove(path);
 

Note: All paths and keys used in this manager are assumed to be non-null.

See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    @NonNull org.eclipse.core.runtime.IPath
    getConvertedKey(@NonNull org.eclipse.core.runtime.IPath path)
    Retrieves the converted key for the specified path.
    @NonNull Map<String,String>
    getConvertedValues(@NonNull org.eclipse.core.runtime.IPath path)
    Retrieves the converted values for the specified path.
    Retrieves the target language for the conversion process.
    org.eclipse.core.resources.IProject
    Retrieves the translated project associated with this manager.
    void
    remove(@NonNull org.eclipse.core.runtime.IPath path)
    Removes all conversion data associated with the specified path.
    void
    removeConvertedKey(@NonNull org.eclipse.core.runtime.IPath path)
    Removes the key associated with the specified path from the conversion process.
    void
    removeConvertedValues(@NonNull org.eclipse.core.runtime.IPath path)
    Removes the values associated with the specified path from the conversion process.
    void
    runConverter(@NonNull org.eclipse.core.resources.IProject sourceLanguageProject, @NonNull org.eclipse.core.resources.IProject targetLanguageProject)
    Initiates the converter to perform the conversion between the source and target language projects.
    void
    updateConvertedKey(@NonNull org.eclipse.core.runtime.IPath sourcePath, @NonNull org.eclipse.core.runtime.IPath targetPath)
    Updates the key associated with the specified path during the conversion process.
    void
    updateConvertedValues(@NonNull org.eclipse.core.runtime.IPath path, @NonNull FeatureKey sourceKey, @NonNull FeatureKey targetKey)
    Updates the values associated with the specified path during the conversion process.
    void
    updateStringLiteralParams(@NonNull org.eclipse.core.runtime.IPath path, @NonNull String name, @NonNull String translation)
    Updates the parameters in the string literal with their corresponding translations.
  • Method Details

    • getProject

      org.eclipse.core.resources.IProject getProject()
      Retrieves the translated project associated with this manager.
      Returns:
      the translated project, cannot be null.
    • getLanguage

      TranslateLanguage getLanguage()
      Retrieves the target language for the conversion process.
      Returns:
      the target language, cannot be null.
    • runConverter

      void runConverter(@NonNull org.eclipse.core.resources.IProject sourceLanguageProject, @NonNull org.eclipse.core.resources.IProject targetLanguageProject)
      Initiates the converter to perform the conversion between the source and target language projects.
      Parameters:
      sourceLanguageProject - the source language project, cannot be null.
      targetLanguageProject - the target language project, cannot be null.
    • getConvertedKey

      @NonNull org.eclipse.core.runtime.IPath getConvertedKey(@NonNull org.eclipse.core.runtime.IPath path)
      Retrieves the converted key for the specified path.
      Parameters:
      path - the path for which to retrieve the converted key, cannot be null.
      Returns:
      the converted key, cannot be null.
    • updateConvertedKey

      void updateConvertedKey(@NonNull org.eclipse.core.runtime.IPath sourcePath, @NonNull org.eclipse.core.runtime.IPath targetPath)
      Updates the key associated with the specified path during the conversion process.
      Parameters:
      sourcePath - the source path for which to update the key, cannot be null.
      targetPath - the target path to set, cannot be null.
    • removeConvertedKey

      void removeConvertedKey(@NonNull org.eclipse.core.runtime.IPath path)
      Removes the key associated with the specified path from the conversion process.
      Parameters:
      path - the path for which to remove the key, cannot be null.
    • getConvertedValues

      @NonNull Map<String,String> getConvertedValues(@NonNull org.eclipse.core.runtime.IPath path)
      Retrieves the converted values for the specified path.
      Parameters:
      path - the path reference for which to retrieve the converted values, cannot be null.
      Returns:
      a map of converted values, where the keys are original values and the values are their converted counterparts, cannot be null
    • updateConvertedValues

      void updateConvertedValues(@NonNull org.eclipse.core.runtime.IPath path, @NonNull FeatureKey sourceKey, @NonNull FeatureKey targetKey)
      Updates the values associated with the specified path during the conversion process.
      Parameters:
      path - the path reference for which to update the values, cannot be null.
      sourceKey - the source key to update, cannot be null.
      targetKey - the target key to set, cannot be null.
    • updateStringLiteralParams

      void updateStringLiteralParams(@NonNull org.eclipse.core.runtime.IPath path, @NonNull String name, @NonNull String translation)
      Updates the parameters in the string literal with their corresponding translations.
      Parameters:
      path - the path to the file containing the string literal, cannot be null.
      name - the parameter name in the original string literal, cannot be null.
      translation - the translated parameter name, cannot be null.
    • removeConvertedValues

      void removeConvertedValues(@NonNull org.eclipse.core.runtime.IPath path)
      Removes the values associated with the specified path from the conversion process.
      Parameters:
      path - the path reference for which to remove the values, cannot be null.
    • remove

      void remove(@NonNull org.eclipse.core.runtime.IPath path)
      Removes all conversion data associated with the specified path.
      Parameters:
      path - the path for which to remove all conversion data, cannot be null.