Package com.e1c.langtool.converter
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 TypeMethodDescription@NonNull org.eclipse.core.runtime.IPathgetConvertedKey(@NonNull org.eclipse.core.runtime.IPath path) Retrieves the converted key for the specified path.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.IProjectRetrieves the translated project associated with this manager.voidremove(@NonNull org.eclipse.core.runtime.IPath path) Removes all conversion data associated with the specified path.voidremoveConvertedKey(@NonNull org.eclipse.core.runtime.IPath path) Removes the key associated with the specified path from the conversion process.voidremoveConvertedValues(@NonNull org.eclipse.core.runtime.IPath path) Removes the values associated with the specified path from the conversion process.voidrunConverter(@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.voidupdateConvertedKey(@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.voidupdateConvertedValues(@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.voidupdateStringLiteralParams(@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 benull.targetLanguageProject- the target language project, cannot benull.
-
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 benull.- 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 benull.targetPath- the target path to set, cannot benull.
-
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 benull.
-
getConvertedValues
Retrieves the converted values for the specified path.- Parameters:
path- the path reference for which to retrieve the converted values, cannot benull.- 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 benull.sourceKey- the source key to update, cannot benull.targetKey- the target key to set, cannot benull.
-
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 benull.name- the parameter name in the original string literal, cannot benull.translation- the translated parameter name, cannot benull.
-
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 benull.
-
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 benull.
-