Interface IExternalPropertyManager


  • public interface IExternalPropertyManager
    Metadata external properties manager.

    Back references are automatically managed if EClass feature is annotated with #EXTERNAL_PROPERTY_ANNOTATION annotation.

    Information about external properties should be persisted. So it is not lost after application shutdown.

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      <T extends org.eclipse.emf.ecore.EObject>
      T
      getOwner​(org.eclipse.emf.ecore.EObject referenceObject, Class<T> ownerType)
      Returns owner for given object.
      org.eclipse.emf.ecore.EReference getReference​(org.eclipse.emf.ecore.EObject referenceObject)
      Returns reference which holds reference to external property
      void registerExternalProperty​(org.eclipse.emf.ecore.EObject owner, org.eclipse.emf.ecore.EReference reference, org.eclipse.emf.ecore.EObject externalProperty)
      Registers back reference to owner from referenceObject.
      void unregisterExternalProperty​(org.eclipse.emf.common.util.URI deassociatedUri)
      Unregisters back reference from referenceObject by URI.
      void unregisterExternalProperty​(org.eclipse.emf.ecore.EObject externalProperty)
      Unregisters back reference from referenceObject.
    • Method Detail

      • getOwner

        <T extends org.eclipse.emf.ecore.EObject> T getOwner​(org.eclipse.emf.ecore.EObject referenceObject,
                                                             Class<T> ownerType)
        Returns owner for given object.
        Parameters:
        referenceObject - the object to get owner for (not null)
        ownerType - the owner type (not null)
        Returns:
        the owner object for what back reference was registered or null if there is no back reference.
      • getReference

        org.eclipse.emf.ecore.EReference getReference​(org.eclipse.emf.ecore.EObject referenceObject)
        Returns reference which holds reference to external property
        Parameters:
        referenceObject - the object to get owner for (not null)
        Returns:
        the owner reference for what back reference object was registered or null if there is no back reference.
      • registerExternalProperty

        void registerExternalProperty​(org.eclipse.emf.ecore.EObject owner,
                                      org.eclipse.emf.ecore.EReference reference,
                                      org.eclipse.emf.ecore.EObject externalProperty)
        Registers back reference to owner from referenceObject. You can get owner object for referenceObject calling #getOwner(EObject). Reference object can have only one owner object. Consequent calls change owner to last called value.
        Parameters:
        owner - the owner object (not null)
        reference - the object feature which holds reference to external property (not null)
        externalProperty - the referenced object, can be proxy (not null)
      • unregisterExternalProperty

        void unregisterExternalProperty​(org.eclipse.emf.ecore.EObject externalProperty)
        Unregisters back reference from referenceObject.
        Parameters:
        externalProperty - the referenced object, can be proxy (not null)
      • unregisterExternalProperty

        void unregisterExternalProperty​(org.eclipse.emf.common.util.URI deassociatedUri)
        Unregisters back reference from referenceObject by URI.
        Parameters:
        deassociatedUri - Usually deassociated objects lack the resource, so normal resolving won't work for them. So one need to supply the URI of the object being just removed.