Package com._1c.g5.v8.derived.context
Class PartBasedContextCollectorBuilder
java.lang.Object
com._1c.g5.v8.derived.context.PartBasedContextCollectorBuilder
A convenience class allowing to describe behavior of a scope collector
using a set of simple rules and then build an instance of
See the usage example below.
IScopeCollector
in compliance with these rules.See the usage example below.
ICaseSpecificScopeCollector onFeatureBChangeScopeCollector = ... IScopeCollector scopeCollector = new ScopeCollectorBuilder(SOME_OBJECT_TYPE) .onAssociation().compute(PART_A, PART_B) .onChange(FEATURE_A) .compute(PART_B) .flowChildren(FEATURE_C).compute(PART_A, PART_B) .onChange(FEATURE_B).compute(onFeatureBChangeScopeCollector) .build();
-
Constructor Summary
ConstructorsConstructorDescriptionPartBasedContextCollectorBuilder
(String segmentId, org.eclipse.emf.ecore.EClass supportedType) Constructs a new instance for the given BM object type. -
Method Summary
Modifier and TypeMethodDescriptionbuild()
Builds a scope collector instance in compliance with the previously specified rule set.compute
(ICaseSpecificContextCollector customContextCollector) Says that in case of the previously specified event, the given custom scope collector must be invoked to define which parts of the previously specified object must be computed.
Custom context collectors cannot be combined with standard ones (defined via other compute***(..) methods) or other custom context collectors.Says that in case of the previously specified event, the given parts of the previously specified object must be computed.
Standard context collecting rules cannot be combined with custom ones (defined via compute(ICaseSpecificContextCollector) method).computeInSegment
(String segmentId, String... partIds) Schedules async re-computation of the DD segment with the given set of parts.
Standard context collecting rules cannot be combined with custom ones (defined via compute(ICaseSpecificContextCollector) method).flowChildren
(org.eclipse.emf.ecore.EReference reference) Says that in case of the previously specified event derived data must be computed for the children of the context object.Says that in case of the previously specified event derived data must be computed for the affected elements of collection.Says that in case of the previously specified event derived data must be computed for the removed elements of collection.Says that in case of the previously specified event derived data must be computed for the direct container of the context object.flowContainer
(int distance) Says that in case of the previously specified event derived data must be computed for the container of the context object.Says to start a rule of derived data computation in case on object association.onChange
(org.eclipse.emf.ecore.EStructuralFeature feature) Says to start a rule of derived data computation in case of given feature change.onChange
(org.eclipse.emf.ecore.EStructuralFeature... features) Collects scope on change of any feature from the provided set.Says to start a rule of derived data computation in case of full object rebuild request.Says to start a rule of derived data computation in case of object removal.Sets active DD segments for the current builder.
-
Constructor Details
-
PartBasedContextCollectorBuilder
public PartBasedContextCollectorBuilder(String segmentId, org.eclipse.emf.ecore.EClass supportedType) Constructs a new instance for the given BM object type.- Parameters:
segmentId
- The default DD segment to be used for scope collection.supportedType
- the BM object type to build scope collector for. Cannot benull
.
-
-
Method Details
-
build
Builds a scope collector instance in compliance with the previously specified rule set.- Returns:
- the built scope collector
-
compute
public PartBasedContextCollectorBuilder compute(ICaseSpecificContextCollector customContextCollector) Says that in case of the previously specified event, the given custom scope collector must be invoked to define which parts of the previously specified object must be computed.
Custom context collectors cannot be combined with standard ones (defined via other compute***(..) methods) or other custom context collectors. UseAggregatingContextCollector
instead.- Parameters:
customContextCollector
- the custom scope collector. Cannot be null.- Returns:
- the reference to the current builder for method chaining
-
compute
Says that in case of the previously specified event, the given parts of the previously specified object must be computed.
Standard context collecting rules cannot be combined with custom ones (defined via compute(ICaseSpecificContextCollector) method).- Parameters:
partIds
- the IDs of the derived data parts to compute- Returns:
- the reference to the current builder for method chaining
-
computeInSegment
Schedules async re-computation of the DD segment with the given set of parts.
Standard context collecting rules cannot be combined with custom ones (defined via compute(ICaseSpecificContextCollector) method).- Parameters:
partIds
- The set of parts for the re-computation.- Returns:
- the reference to the current builder for method chaining
-
flowChildren
Says that in case of the previously specified event derived data must be computed for the children of the context object.- Parameters:
reference
- a reference to the children- Returns:
- the reference to the current builder for method chaining
-
flowCollectionAffectedElements
Says that in case of the previously specified event derived data must be computed for the affected elements of collection.- Returns:
- the reference to the current builder for method chaining
-
flowCollectionRemovedElements
Says that in case of the previously specified event derived data must be computed for the removed elements of collection.- Returns:
- the reference to the current builder for method chaining
-
flowContainer
Says that in case of the previously specified event derived data must be computed for the direct container of the context object.- Returns:
- the reference to the current builder for method chaining
-
flowContainer
Says that in case of the previously specified event derived data must be computed for the container of the context object.- Parameters:
distance
- the distance to the container. If distance is 1, it means that the derived data must be computed for the direct container, if 2, for the container of the container, and so on- Returns:
- the reference to the current builder for method chaining
-
onAssociation
Says to start a rule of derived data computation in case on object association.- Returns:
- the reference to the current builder for method chaining
-
onChange
Says to start a rule of derived data computation in case of given feature change.- Parameters:
feature
- the feature- Returns:
- the reference to the current builder for method chaining
-
onChange
public PartBasedContextCollectorBuilder onChange(org.eclipse.emf.ecore.EStructuralFeature... features) Collects scope on change of any feature from the provided set. This is a convinience method to define similar scope collecting rules.- Parameters:
features
- The set of features.- Returns:
- the reference to the current builder for method chaining
-
onFullRebuild
Says to start a rule of derived data computation in case of full object rebuild request.- Returns:
- the reference to the current builder for method chaining
-
onRemoval
Says to start a rule of derived data computation in case of object removal.- Returns:
- the reference to the current builder for method chaining
-
segment
Sets active DD segments for the current builder. All next scope definitions are being collected for this segment.- Parameters:
segmentId
- The DD segment to set. Cannot benull
- Returns:
- the reference to the current builder for method chaining
-