Class MdAdoptedPropertyAccess

java.lang.Object
com._1c.g5.v8.dt.internal.md.extension.MdAdoptedPropertyAccess
All Implemented Interfaces:
IMdAdoptedPropertyAccess

public class MdAdoptedPropertyAccess extends Object implements IMdAdoptedPropertyAccess
Implementation of IMdAdoptedPropertyAccess.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    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.
    protected org.eclipse.emf.ecore.EStructuralFeature
    checkProperty(org.eclipse.emf.ecore.EObject originalObject, org.eclipse.emf.ecore.EStructuralFeature originalFeature, MdPropertyType propertyType)
    Checks that property usage is valid for the given object and property type.
    protected Pair<org.eclipse.emf.ecore.EObject,org.eclipse.emf.ecore.EStructuralFeature>
    getExtensionProperty(org.eclipse.emf.ecore.EObject originalObject, org.eclipse.emf.ecore.EStructuralFeature originalFeature)
    Returns the extension model object and according property for the requested by client property and the given object.
    <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.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • MdAdoptedPropertyAccess

      public MdAdoptedPropertyAccess()
  • Method Details

    • getValue

      public <T> T getValue(org.eclipse.emf.ecore.EObject source, org.eclipse.emf.ecore.EStructuralFeature feature, MdPropertyType propertyType)
      Description copied from interface: IMdAdoptedPropertyAccess
      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.

      Specified by:
      getValue in interface IMdAdoptedPropertyAccess
      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
    • hasPropertyState

      public boolean hasPropertyState(org.eclipse.emf.ecore.EObject source, org.eclipse.emf.ecore.EStructuralFeature feature, MdPropertyState state)
      Description copied from interface: IMdAdoptedPropertyAccess
      Returns whether the adopted metadata object property has the provided state.
      Specified by:
      hasPropertyState in interface IMdAdoptedPropertyAccess
      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

      public void setValue(org.eclipse.emf.ecore.EObject target, org.eclipse.emf.ecore.EStructuralFeature feature, MdPropertyType propertyType, Object newValue)
      Description copied from interface: IMdAdoptedPropertyAccess
      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.

      Specified by:
      setValue in interface IMdAdoptedPropertyAccess
      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
    • setPropertyState

      public void setPropertyState(org.eclipse.emf.ecore.EObject target, org.eclipse.emf.ecore.EStructuralFeature feature, MdPropertyState state)
      Description copied from interface: IMdAdoptedPropertyAccess
      Sets adopted metadata object property state.
      Specified by:
      setPropertyState in interface IMdAdoptedPropertyAccess
      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
    • acceptWithExtension

      public void acceptWithExtension(org.eclipse.emf.ecore.EObject target, Consumer<ObjectExtension> action)
      Description copied from interface: IMdAdoptedPropertyAccess
      Applies the provided action to the object extension.
      Specified by:
      acceptWithExtension in interface IMdAdoptedPropertyAccess
      Parameters:
      target - the object to set property state, cannot be null
      action - the action to apply, cannot be null
    • applyToExtension

      public <T> Optional<T> applyToExtension(org.eclipse.emf.ecore.EObject target, Function<ObjectExtension,T> action)
      Description copied from interface: IMdAdoptedPropertyAccess
      Applies the provided action to the object extension.
      Specified by:
      applyToExtension in interface IMdAdoptedPropertyAccess
      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
    • checkProperty

      protected org.eclipse.emf.ecore.EStructuralFeature checkProperty(org.eclipse.emf.ecore.EObject originalObject, org.eclipse.emf.ecore.EStructuralFeature originalFeature, MdPropertyType propertyType)
      Checks that property usage is valid for the given object and property type. Returns the validated property to provide an ability to construct fluent code.
      Parameters:
      originalObject - the object to check property, cannot be null
      originalFeature - the property to check, cannot be null
      propertyType - the metadata property type, cannot be null
      Returns:
      the valid property that was validated, never null
    • getExtensionProperty

      protected Pair<org.eclipse.emf.ecore.EObject,org.eclipse.emf.ecore.EStructuralFeature> getExtensionProperty(org.eclipse.emf.ecore.EObject originalObject, org.eclipse.emf.ecore.EStructuralFeature originalFeature)
      Returns the extension model object and according property for the requested by client property and the given object.
      Parameters:
      originalObject - the object to get extension object property, cannot be null
      originalFeature - the property to get extension property for, cannot be null
      Returns:
      the extension model object and according property, never null