Class PropertyStateModel

    • Constructor Detail

      • PropertyStateModel

        public PropertyStateModel​(org.eclipse.emf.ecore.EObject object,
                                  org.eclipse.emf.ecore.EStructuralFeature feature,
                                  IMdAdoptedPropertyAccess mdAdoptedPropertyAccess,
                                  IMdAdoptedPropertyNotifier mdAdoptedPropertyNotifier,
                                  IModelObjectAdopter modelObjectAdopter)
        Constructor of PropertyStateModel.
        Parameters:
        object - the object, cannot be null
        feature - the object feature, cannot be null
        mdAdoptedPropertyAccess - the metadata adopted property access, cannot be null
        mdAdoptedPropertyNotifier - the metadata adopted property notifier, cannot be null
        modelObjectAdopter - the model object adopter, cannot be null
    • Method Detail

      • getObjectValue

        protected MdPropertyState getObjectValue​(org.eclipse.emf.ecore.EObject object,
                                                 org.eclipse.emf.ecore.EStructuralFeature feature,
                                                 boolean resolve)
        Description copied from class: BmValue
        Gets the current value of the provided model object feature.
        Overrides:
        getObjectValue in class BmValue<MdPropertyState>
        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,
                                      MdPropertyState newValue)
        Description copied from class: BmValue
        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).
        Overrides:
        setObjectValue in class BmValue<MdPropertyState>
        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)
        Description copied from class: BmValue
        Process the BM value change and apply changes to this BmValue.
        Overrides:
        processBmValueChange in class BmValue<MdPropertyState>
        Parameters:
        value - the new value, can be null
      • shouldUnsetValue

        protected boolean shouldUnsetValue​(org.eclipse.emf.ecore.EObject object,
                                           org.eclipse.emf.ecore.EStructuralFeature feature,
                                           MdPropertyState newState)
        Check value is should be unset to default
        Parameters:
        object - the object to set new value, cannot be null.
        feature - the feture to set, cannot be null.
        newState - the new state value to set, can be null.
        Returns:
        true if value in given object and specified feature should be unsets, false in otherwise
      • unsetValue

        protected void unsetValue​(org.eclipse.emf.ecore.EObject object,
                                  org.eclipse.emf.ecore.EStructuralFeature feature)
        Set default value to given object in specified feature
        Parameters:
        object - the object to set new value, cannot be null.
        feature - the feture to set, cannot be null.
      • shouldSetSourceValue

        protected boolean shouldSetSourceValue​(org.eclipse.emf.ecore.EObject object,
                                               org.eclipse.emf.ecore.EStructuralFeature feature,
                                               MdPropertyType type,
                                               MdPropertyState newState)
        Check value is should be set to new state
        Parameters:
        target - the object to set property, cannot be null
        feature - the property to set, cannot be null
        type - the metadata property type, cannot be null
        newState - the new value of the given property, may be null to erase property value
        Returns:
        true if value in given object and specified feature should be unsets, false in otherwise