Class FeatureValueCollectingService
java.lang.Object
com.e1c.langtool.internal.collector.FeatureValueCollectingService
- All Implemented Interfaces:
IFeatureValueCollectingService
-
Constructor Summary
Constructors -
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.createCollectors(TranslationSource source, ICollectingParameters parameters, BiConsumer<Object, FeatureValue> addAction, org.eclipse.core.runtime.IProgressMonitor monitor) 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.
-
Constructor Details
-
FeatureValueCollectingService
public FeatureValueCollectingService()
-
-
Method Details
-
hasCollector
Description copied from interface:IFeatureValueCollectingServiceChecks if a collector can be created for the given source object.- Specified by:
hasCollectorin interfaceIFeatureValueCollectingService- Parameters:
source- the source object, if it is aTranslationSourceobject the check will be forTranslationSource.getSourceObject()- Returns:
true, if collector can be created
-
createCollectors
public Set<FeatureValueCollector> createCollectors(TranslationSource source, ICollectingParameters parameters, BiConsumer<Object, FeatureValue> addAction) Description copied from interface:IFeatureValueCollectingServiceCreates the collectors for the given source object. This method should be uses in an implementation ofFeatureCollectorFactoryto create collectors for sub objects.- Specified by:
createCollectorsin interfaceIFeatureValueCollectingService- 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
-
createCollectors
public Set<FeatureValueCollector> createCollectors(TranslationSource source, ICollectingParameters parameters, BiConsumer<Object, FeatureValue> addAction, org.eclipse.core.runtime.IProgressMonitor monitor) -
collectAll
public void collectAll(org.eclipse.core.resources.IProject project, ICollectingParameters parameters, BiConsumer<Object, FeatureValue> action, ExecutorService executorService, org.eclipse.core.runtime.IProgressMonitor monitor) Description copied from interface:IFeatureValueCollectingServiceCollects feature values and raw source object for the given project and process given actionBiConsumerfor each of all collected values from project.- Specified by:
collectAllin interfaceIFeatureValueCollectingService- 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.
-
collectAllByFile
public 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) Description copied from interface:IFeatureValueCollectingServiceCollectFeatureValuefrom all files of the project with using or updating resource cache. This method return result to consumer all collected values by file at ones.- Specified by:
collectAllByFilein interfaceIFeatureValueCollectingService- 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
public void collectFile(org.eclipse.core.resources.IFile file, ICollectingParameters parameters, BiConsumer<Object, FeatureValue> action, org.eclipse.core.runtime.IProgressMonitor monitor) Description copied from interface:IFeatureValueCollectingServiceCollect allFeatureValuefrom file. This action use cache if exist or update it after collecting.- Specified by:
collectFilein interfaceIFeatureValueCollectingService- Parameters:
file- the file, cannot benull.parameters- the parameters, cannot benull.action- the action, cannot benull.monitor- the monitor, cannot benull.
-
forEachCollected
public void forEachCollected(TranslationSource source, ICollectingParameters parameters, org.eclipse.core.runtime.IProgressMonitor monitor, BiConsumer<Object, FeatureValue> action) Description copied from interface:IFeatureValueCollectingServiceCollect feature values and raw source object for the given translation source with parameters and process given actionBiConsumerfor each collected.- Specified by:
forEachCollectedin interfaceIFeatureValueCollectingService- 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.
-