Interface IMdAdoptedPropertyAccess


  • public interface IMdAdoptedPropertyAccess
    Metadata adopted property access support allows clients to get and set adopted metadata objects properties.

    Instead of manual metadata model object manipulations IMdAdoptedPropertySupport performs actions with respect to 1C:Enterprise runtime properties versions and property types restrictions, and internal extension values management.

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void acceptWithExtension​(org.eclipse.emf.ecore.EObject target, Consumer<ObjectExtension> action)
      Applies the provided action to the object extension.
      <T> Optional<T> applyToExtension​(org.eclipse.emf.ecore.EObject target, Function<ObjectExtension,​T> action)
      Applies the provided action to the object extension.
      <T> T getValue​(org.eclipse.emf.ecore.EObject source, org.eclipse.emf.ecore.EStructuralFeature feature, MdPropertyType propertyType)
      Gets the given property value of the given object and the given metadata property type.
      boolean hasPropertyState​(org.eclipse.emf.ecore.EObject source, org.eclipse.emf.ecore.EStructuralFeature feature, MdPropertyState state)
      Returns whether the adopted metadata object property has the provided state.
      void setPropertyState​(org.eclipse.emf.ecore.EObject target, org.eclipse.emf.ecore.EStructuralFeature feature, MdPropertyState state)
      Sets adopted metadata object property state.
      void setValue​(org.eclipse.emf.ecore.EObject target, org.eclipse.emf.ecore.EStructuralFeature feature, MdPropertyType propertyType, Object newValue)
      Sets the given property value to the given object and the given metadata property type.
    • Method Detail

      • getValue

        <T> T getValue​(org.eclipse.emf.ecore.EObject source,
                       org.eclipse.emf.ecore.EStructuralFeature feature,
                       MdPropertyType propertyType)
        Gets the given property value of the given object and the given metadata property type.

        Actual value may be various: simple primitive value, reference, list or a map of values, based on actual metadata model content.

        Parameters:
        source - the object to get property, cannot be null
        feature - the property to get, cannot be null
        propertyType - the metadata property type, cannot be null
        Returns:
        the given property value of the given object, may be null if the value actually is null
        Throws:
        UnsupportedPropertyTypeException - if the given object does not support the given property type
        ClassCastException - if the returned property value is not a generic type of the method call
      • hasPropertyState

        boolean hasPropertyState​(org.eclipse.emf.ecore.EObject source,
                                 org.eclipse.emf.ecore.EStructuralFeature feature,
                                 MdPropertyState state)
        Returns whether the adopted metadata object property has the provided state.
        Parameters:
        source - the object to get value state, cannot be null
        feature - the property to get, cannot be null
        state - the metadata property state to check, cannot be null
        Returns:
        whether the adopted metadata object property has the provided state
      • setValue

        void setValue​(org.eclipse.emf.ecore.EObject target,
                      org.eclipse.emf.ecore.EStructuralFeature feature,
                      MdPropertyType propertyType,
                      Object newValue)
        Sets the given property value to the given object and the given metadata property type.

        Actual value may be various: simple primitive value, reference, list or a map of values, based on actual metadata model content.

        Parameters:
        target - the object to set property, cannot be null
        feature - the property to set, cannot be null
        propertyType - the metadata property type, cannot be null
        newValue - the new value of the given property, may be null to erase property value
        Throws:
        UnsupportedPropertyTypeException - if the given object does not support the given property type
        ClassCastException - if the given newValue type does not match with the real type of the given property
      • setPropertyState

        void setPropertyState​(org.eclipse.emf.ecore.EObject target,
                              org.eclipse.emf.ecore.EStructuralFeature feature,
                              MdPropertyState state)
        Sets adopted metadata object property state.
        Parameters:
        target - the object to set property state, cannot be null
        feature - the property to set state, cannot be null
        state - the metadata property state, cannot be null
        Throws:
        UnsupportedPropertyTypeException - if the given object does not support the given property type
      • acceptWithExtension

        void acceptWithExtension​(org.eclipse.emf.ecore.EObject target,
                                 Consumer<ObjectExtension> action)
        Applies the provided action to the object extension.
        Parameters:
        target - the object to set property state, cannot be null
        action - the action to apply, cannot be null
      • applyToExtension

        <T> Optional<T> applyToExtension​(org.eclipse.emf.ecore.EObject target,
                                         Function<ObjectExtension,​T> action)
        Applies the provided action to the object extension.
        Parameters:
        target - the object to set property state, cannot be null
        action - the action to apply, cannot be null
        Returns:
        the optional result of the action