Package com.e1c.langtool.collector
Interface IFeatureValueCollectingService
- All Known Implementing Classes:
FeatureValueCollectingService
public interface IFeatureValueCollectingService
The Interface of the service collecting
FeatureValue with registred FeatureValueCollector factories.-
Method Summary
Modifier and TypeMethodDescriptionvoidcollectAll(org.eclipse.core.resources.IProject project, ICollectingParameters parameters, BiConsumer<Object, FeatureValue> action, ExecutorService executorService, org.eclipse.core.runtime.IProgressMonitor monitor) Collects feature values and raw source object for the given project and process given actionBiConsumerfor each of all collected values from project.voidcollectAllByFile(org.eclipse.core.resources.IProject project, ICollectingParameters parameters, BiConsumer<org.eclipse.core.resources.IFile, Collection<FeatureValue>> action, ExecutorService executorService, org.eclipse.core.runtime.IProgressMonitor monitor) CollectFeatureValuefrom all files of the project with using or updating resource cache.voidcollectFile(org.eclipse.core.resources.IFile file, ICollectingParameters parameters, BiConsumer<Object, FeatureValue> action, org.eclipse.core.runtime.IProgressMonitor monitor) Collect allFeatureValuefrom file.createCollectors(TranslationSource source, ICollectingParameters parameters, BiConsumer<Object, FeatureValue> addAction) Creates the collectors for the given source object.voidforEachCollected(TranslationSource source, ICollectingParameters parameters, org.eclipse.core.runtime.IProgressMonitor monitor, BiConsumer<Object, FeatureValue> action) Collect feature values and raw source object for the given translation source with parameters and process given actionBiConsumerfor each collected.booleanhasCollector(Object source) Checks if a collector can be created for the given source object.
-
Method Details
-
hasCollector
Checks if a collector can be created for the given source object.- Parameters:
source- the source object, if it is aTranslationSourceobject the check will be forTranslationSource.getSourceObject()- Returns:
true, if collector can be created
-
forEachCollected
void forEachCollected(TranslationSource source, ICollectingParameters parameters, org.eclipse.core.runtime.IProgressMonitor monitor, BiConsumer<Object, FeatureValue> action) Collect feature values and raw source object for the given translation source with parameters and process given actionBiConsumerfor each collected.- Parameters:
source- the source, cannot benull.parameters- the parameters, cannot benull.monitor- the monitor, cannot benull.action- the action to do with collected each feature value. The first argument ofBiConsumeris the source raw object that provides aFeatureValueand the second argument of the action is the feature value to handle. Warning: the action is responsible to be thread-safe, no guarantee that collecting process and action will be in same thread.
-
collectAllByFile
void collectAllByFile(org.eclipse.core.resources.IProject project, ICollectingParameters parameters, BiConsumer<org.eclipse.core.resources.IFile, Collection<FeatureValue>> action, ExecutorService executorService, org.eclipse.core.runtime.IProgressMonitor monitor) CollectFeatureValuefrom all files of the project with using or updating resource cache. This method return result to consumer all collected values by file at ones.- Parameters:
project- the project to collect, cannot benull.parameters- the parameters, cannot benull.action- the consumer action to get collection ofFeatureValueby the file, cannot benull.executorService- the executor service, cannot benull.monitor- the monitor, cannot benull.
-
collectFile
void collectFile(org.eclipse.core.resources.IFile file, ICollectingParameters parameters, BiConsumer<Object, FeatureValue> action, org.eclipse.core.runtime.IProgressMonitor monitor) Collect allFeatureValuefrom file. This action use cache if exist or update it after collecting.- Parameters:
file- the file, cannot benull.parameters- the parameters, cannot benull.action- the action, cannot benull.monitor- the monitor, cannot benull.
-
collectAll
void collectAll(org.eclipse.core.resources.IProject project, ICollectingParameters parameters, BiConsumer<Object, FeatureValue> action, ExecutorService executorService, org.eclipse.core.runtime.IProgressMonitor monitor) Collects feature values and raw source object for the given project and process given actionBiConsumerfor each of all collected values from project.- Parameters:
project- the project, cannot benull.parameters- the parameters, cannot benull.action- the action to do with collected each feature value. The first argument ofBiConsumeris the object that provides aFeatureValueand the second argument of the action is the feature value to handle. Warning: the action is responsible to be thread-safe, no guarantee that collecting process and action will be in same thread.executorService- the executor service, cannot benull.monitor- the monitor, cannot benull.
-
createCollectors
Collection<FeatureValueCollector> createCollectors(TranslationSource source, ICollectingParameters parameters, BiConsumer<Object, FeatureValue> addAction) Creates the collectors for the given source object. This method should be uses in an implementation ofFeatureCollectorFactoryto create collectors for sub objects.- Parameters:
source- the source object which has translatable features, cannot benull.parameters- the parameters, cannot benull.addAction- the add action, cannot benull.- Returns:
- the collection the of newly created collectors, cannot return
null. - See Also:
-
to collect FeatureValue seecollect().FeatureCollectorFactoryFeatureValueCollector
-