Class StandardContextCollectorBuilder


  • public class StandardContextCollectorBuilder
    extends Object
    A convenience class allowing to describe behavior of a scope collector using a set of simple rules and then build an instance of 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();
     
    See Also:
    IContextCollector, ICaseSpecificContextCollector
    • Constructor Detail

      • StandardContextCollectorBuilder

        public StandardContextCollectorBuilder​(org.eclipse.emf.ecore.EClass supportedType)
        Constructs a new instance for the given BM object type.
        Parameters:
        supportedType - the BM object type to build scope collector for
    • Method Detail

      • build

        public IContextCollector build()
        Builds a scope collector instance in compliance with the previously specified rule set.
        Returns:
        the built scope collector
      • compute

        public StandardContextCollectorBuilder 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.
        Parameters:
        customContextCollector - the custom scope collector
        Returns:
        the reference to the current builder for method chaining
      • onAssociation

        public StandardContextCollectorBuilder 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

        public StandardContextCollectorBuilder onChange​(org.eclipse.emf.ecore.EStructuralFeature feature)
        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
      • onFullRebuild

        public StandardContextCollectorBuilder onFullRebuild()
        Says to start a rule of derived data computation in case of full rebuild request.
        Returns:
        the reference to the current builder for method chaining