Class AbstractBmReferencesCollectorVisitorCallback

  • All Implemented Interfaces:

    public abstract class AbstractBmReferencesCollectorVisitorCallback
    extends Object
    implements IEObjectVisitorCallback
    The abstract IEObjectVisitorCallback implementation.
    It collects BM object cross references and processes it. Successors should implement processReferences(IBmObject, Collection) method to provide processing feature.
    The example below iterates over cross references and prints it to console.
          IEObjectVisitorCallback callback = new AbstractBmReferencesCollectorVisitorCallback(bmModel, dependentModels)
    • Constructor Detail

      • AbstractBmReferencesCollectorVisitorCallback

        public AbstractBmReferencesCollectorVisitorCallback​(IBmModel bmModel,
                                                            Collection<IBmModel> dependentModels)
        Creates a new instance.
        bmModel - the IBmModel, cannot be null.
        dependentModels - the collection of dependent models, cannot be null.
    • Method Detail

      • visit

        public void visit​(org.eclipse.emf.ecore.EObject eObject)
        Description copied from interface: IEObjectVisitorCallback
        Visits the specified eObject.
        Specified by:
        visit in interface IEObjectVisitorCallback
        eObject - the EObject instance, cannot be null.
      • getBmModel

        protected final IBmModel getBmModel()
        Returns the BM model.
        the BM model, never null.
      • getDependentModels

        protected final Collection<IBmModel> getDependentModels()
        Returns a collection of dependent BM models.
        a collection of dependent BM models, never null.
      • isBmObject

        protected final boolean isBmObject​(org.eclipse.emf.ecore.EObject object)
        Checks if the specified object is BM object. It means that object is instance of IBmObject and its engine is not null.
        object - the object to check, cannot be null.
        true if the specified object is BM object, false - otherwise.
      • checkReference

        protected boolean checkReference​(IBmModel bmModel,
                                         IBmCrossReference reference)
        Checks the IBmCrossReference during collecting, before processing. By default it does nothing.
        bmModel - the BM model, cannot be null.
        reference - the reference to check, cannot be null.
        true if the references is checked and should be processed, false - otherwise.
      • processReferences

        protected abstract void processReferences​(IBmObject bmObject,
                                                  Collection<BmModelCrossReference> references)
        Process the references for the specified bmObject.
        bmObject - the BM object, cannot be null.
        references - the references, cannot be null.