Class EMFModel

    • Field Detail

      • elementsByType

        protected java.util.Map<org.eclipse.emf.ecore.EClass,​java.util.Set<org.eclipse.emf.ecore.EObject>> elementsByType
    • Method Detail

      • newElement

        public java.lang.Object newElement​(java.lang.Object metaElement)
        Creates a new element in the model.
        Specified by:
        newElement in interface IModel
        Parameters:
        metaElement - the new element metatype
        Returns:
        the newly created element
        See Also:
        IModel.newElement(java.lang.Object)
      • getElementsByType

        public java.util.Set<org.eclipse.emf.ecore.EObject> getElementsByType​(java.lang.Object metaElement)
        Returns a Set of the elements matching the given type.
        Specified by:
        getElementsByType in interface IModel
        Parameters:
        metaElement - a metatype
        Returns:
        a Set of the elements matching the given type
        See Also:
        IModel.getElementsByType(java.lang.Object)
      • isTarget

        public boolean isTarget()
        Defines if the model is readonly or not.
        Specified by:
        isTarget in interface IModel
        Returns:
        true if the model allows writing
        See Also:
        IModel.isTarget()
      • setIsTarget

        public void setIsTarget​(boolean value)
        Sets if the model is readonly or not.
        Specified by:
        setIsTarget in interface IModel
        Parameters:
        value - true if the model allows writing
        See Also:
        IModel.setIsTarget(boolean)
      • getResource

        public org.eclipse.emf.ecore.resource.Resource getResource()
        Returns the resource.
        Returns:
        the resource
      • setResource

        protected void setResource​(org.eclipse.emf.ecore.resource.Resource resource)
        Sets the resource with the resource value.
        Parameters:
        resource - the resource to set
      • commitToResource

        public void commitToResource()
        Finalizes the model.
      • isModelOf

        public boolean isModelOf​(java.lang.Object object)
        Returns true if the given object is contained in this model's resource or a referenced resource.
        Specified by:
        isModelOf in interface IModel
        Parameters:
        object - the model element
        Returns:
        true if object is contained in this model's resource or a referenced resource
        See Also:
        IModel.isModelOf(java.lang.Object)
      • finalize

        protected void finalize()
                         throws java.lang.Throwable
        Overrides:
        finalize in class java.lang.Object
        Throws:
        java.lang.Throwable
        See Also:
        Object.finalize()