Class ConverterServiceImpl
java.lang.Object
com.e1c.langtool.internal.converter.ConverterServiceImpl
- All Implemented Interfaces:
IManagedService,IConverterService
Implementation of the
IConverterService interface for managing and coordinating language project conversions.
The ConverterServiceImpl class provides methods for managing IConverterManager instances and
coordinating asynchronous language project conversions using an AsyncConverter.
Usage example:
// Create an instance of ITranslatingProjectManager and IConverterEngine
ITranslatingProjectManager translatingProjectManager = ...; // Implement or obtain the instance through dependency injection
IConverterEngine engine = ...; // Implement or obtain the instance through dependency injection
// Create an instance of ConverterServiceImpl
ConverterServiceImpl converterService = new ConverterServiceImpl(translatingProjectManager, engine, storageManager);
// Obtain a IConverterManager for a specific project
IProject project = ...; // Specify the project
IConverterManager manager = converterService.getManager(project);
// Run the converter to perform language project conversion
IProject sourceLangProject = ...; // Specify the source language project
IProject targetLangProject = ...; // Specify the target language project
manager.runConverter(sourceLangProject, targetLangProject);
Note: All projects and managers used in this class are assumed to be non-null.
-
Field Summary
Fields inherited from interface com.e1c.langtool.converter.IConverterService
FAMILY_JOB_NAME -
Constructor Summary
ConstructorsConstructorDescriptionConverterServiceImpl(ITranslatingProjectManager translatingProjectManager, IConverterEngine engine) Creates a new instance ofConverterServiceImplwith the specified parameters. -
Method Summary
Modifier and TypeMethodDescriptionvoidactivate()voidgetManager(org.eclipse.core.resources.IProject project) Retrieves theIConverterManagerassociated with the specified project.
-
Constructor Details
-
ConverterServiceImpl
@Inject public ConverterServiceImpl(ITranslatingProjectManager translatingProjectManager, IConverterEngine engine) Creates a new instance ofConverterServiceImplwith the specified parameters.- Parameters:
translatingProjectManager- the manager for translating projects, cannot benull.engine- the converter engine to use, cannot benull.
-
-
Method Details
-
activate
public void activate()- Specified by:
activatein interfaceIManagedService
-
deactivate
public void deactivate()- Specified by:
deactivatein interfaceIManagedService
-
getManager
Description copied from interface:IConverterServiceRetrieves theIConverterManagerassociated with the specified project.- Specified by:
getManagerin interfaceIConverterService- Parameters:
project- theIProjectsource project for conversion, cannot benull.- Returns:
- the
IConverterManagerfor the specified project, cannot benull.
-