Class BmValue<T>

    • Constructor Detail

      • BmValue

        public BmValue​(org.eclipse.emf.ecore.EObject object,
                       org.eclipse.emf.ecore.EStructuralFeature feature)
        Instantiates a new BM value.
        Parameters:
        object - the object, cannot be null
        feature - the object feature, cannot be null
      • BmValue

        public BmValue​(org.eclipse.emf.ecore.EObject object,
                       org.eclipse.emf.ecore.EStructuralFeature feature,
                       boolean resolve)
        Instantiates a new BM value.
        Parameters:
        object - the object, cannot be null
        feature - the object feature, cannot be null
        resolve - true if need resolve object for feature, false otherwise
      • BmValue

        protected BmValue​(org.eclipse.emf.ecore.EObject object,
                          org.eclipse.emf.ecore.EStructuralFeature feature,
                          T initialValue)
        Instantiates a new BM value with initial value. It is client responsibility to provide valid initial value.
        Parameters:
        object - the object, cannot be null
        feature - the object feature, cannot be null
        initialValue - the initial value, can be null
    • Method Detail

      • getChange

        public IChange getChange()
        Specified by:
        getChange in interface IModel
        Returns:
        change describing the modifications done to the model.
      • dispose

        public void dispose()
        Description copied from interface: IModel
        Disposes this model.
        Specified by:
        dispose in interface IModel
        Overrides:
        dispose in class Value<T>
      • getObject

        public IBmObject getObject()
        Description copied from interface: IAttribute
        Returns the object that keeps the attribute.
        Specified by:
        getObject in interface IAttribute<IBmObject,​org.eclipse.emf.ecore.EStructuralFeature>
        Returns:
        the object that keeps the attribute.
      • getProperty

        public org.eclipse.emf.ecore.EStructuralFeature getProperty()
        Description copied from interface: IAttribute
        Returns the property.
        Specified by:
        getProperty in interface IAttribute<IBmObject,​org.eclipse.emf.ecore.EStructuralFeature>
        Returns:
        the property.
      • createTask

        protected IModelApiTaskN<Void> createTask​(IBmObject object,
                                                  org.eclipse.emf.ecore.EStructuralFeature feature,
                                                  T valueToApply)
        Creates an IModelApiTaskN that executes during applying changes.
        Parameters:
        object - the object to change, cannot be null.
        feature - the feature the feature to change, cannot be null.
        valueToApply - the value to apply.
        Returns:
        the created IModelApiTaskN.
      • getObjectValue

        protected T getObjectValue​(org.eclipse.emf.ecore.EObject object,
                                   org.eclipse.emf.ecore.EStructuralFeature feature,
                                   boolean resolve)
        Gets the current value of the provided model object feature.
        Parameters:
        object - the object to get new value, cannot be null
        feature - the feture to get, cannot be null
        Returns:
        the current value, can be null
      • setObjectValue

        protected void setObjectValue​(org.eclipse.emf.ecore.EObject object,
                                      org.eclipse.emf.ecore.EStructuralFeature feature,
                                      T newValue)
        Sets the new value of the provided model object feature during the commit.
        The method is invoked within the task, so the given objects have the relevant state (e.g. attached to transaction).
        Parameters:
        object - the object to set new value, cannot be null.
        feature - the feture to set, cannot be null.
        newValue - the new value to set, can be null.
      • processBmValueChange

        protected void processBmValueChange​(Object value)
        Process the BM value change and apply changes to this BmValue.
        Parameters:
        value - the new value, can be null
      • adapt

        protected static IModelApiTaskN<Void> adapt​(IBmTask<?> bmTask)
        Converts the specified BM task to IModelApiTaskN.

        NOTE: this method is required until exists the API (tasks) that encapsulates the business logic in the BM task manner.

        Parameters:
        bmTask - the BM task, cannot be null.
        Returns:
        model api task, never null.