Class AbstractEmfModel

    • Field Detail

      • PROPERTY_EXPAND

        public static final java.lang.String PROPERTY_EXPAND
        One of the keys used to construct the first argument to Model.load(StringProperties, String). When paired with "true", external references will be resolved during loading. Otherwise, external references are not resolved. Paired with "true" by default.
        See Also:
        Constant Field Values
      • PROPERTY_PARALLELALLOF

        public static final java.lang.String PROPERTY_PARALLELALLOF
        Whether to perform getAllOfKind and getAllOfType operations in parallel. False by default.
        See Also:
        Constant Field Values
      • modelImpl

        protected org.eclipse.emf.ecore.resource.Resource modelImpl
      • expand

        protected boolean expand
      • registry

        protected org.eclipse.emf.ecore.EPackage.Registry registry
    • Constructor Detail

      • AbstractEmfModel

        public AbstractEmfModel()
    • Method Detail

      • getInputStream

        protected java.io.InputStream getInputStream​(java.lang.String file)
                                              throws java.io.IOException
        Throws:
        java.io.IOException
      • addMetamodelUri

        public void addMetamodelUri​(java.lang.String nsUri)
      • getPackageRegistry

        protected org.eclipse.emf.ecore.EPackage.Registry getPackageRegistry()
        Get the (cached) package registry belonging to the model implementation, if no registry is available the global one is provided
        Returns:
        the (global) package registry
      • knowsAboutProperty

        public boolean knowsAboutProperty​(java.lang.Object instance,
                                          java.lang.String property)
        Description copied from interface: IModel
        Returns true if this instance could have this property at some point.
        Specified by:
        knowsAboutProperty in interface IModel
        Overrides:
        knowsAboutProperty in class Model
      • knowsAboutProperty

        protected boolean knowsAboutProperty​(org.eclipse.emf.ecore.EObject instance,
                                             java.lang.String property)
      • isPropertySet

        public boolean isPropertySet​(java.lang.Object instance,
                                     java.lang.String property)
                              throws EolRuntimeException
        Description copied from interface: IModel
        Returns true if this instance has an explicit value for this property. This would be equivalent to eIsSet in EMF.
        Specified by:
        isPropertySet in interface IModel
        Overrides:
        isPropertySet in class Model
        Throws:
        EolRuntimeException
      • classForName

        protected org.eclipse.emf.ecore.EClass classForName​(java.lang.String name,
                                                            org.eclipse.emf.ecore.EPackage.Registry registry)
      • classForName

        protected org.eclipse.emf.ecore.EClass classForName​(java.lang.String name,
                                                            boolean absolute,
                                                            org.eclipse.emf.ecore.EPackage pkg)
      • allContentsFromModel

        protected java.util.Collection<org.eclipse.emf.ecore.EObject> allContentsFromModel()
        Specified by:
        allContentsFromModel in class CachedModel<org.eclipse.emf.ecore.EObject>
      • owns

        public boolean owns​(java.lang.Object instance)
        Description copied from interface: IModel
        Used to test whether an object is contained in this model.
        Parameters:
        instance - the Java object to test.
        Returns:
        true if and only if instance is contained by this model.
      • store

        public boolean store​(java.lang.String fileName)
      • store

        public boolean store​(org.eclipse.emf.common.util.URI uri)
      • store

        public boolean store​(java.io.OutputStream os)
      • disposeModel

        public void disposeModel()
        Specified by:
        disposeModel in class CachedModel<org.eclipse.emf.ecore.EObject>
      • getResource

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

        public void setResource​(org.eclipse.emf.ecore.resource.Resource resource)
      • getModelImpl

        @Deprecated
        public org.eclipse.emf.ecore.resource.Resource getModelImpl()
        Deprecated.
        Use getResource() instead
      • setModelImpl

        public void setModelImpl​(org.eclipse.emf.ecore.resource.Resource modelImpl)
        Deprecated.
      • getResources

        protected java.util.List<org.eclipse.emf.ecore.resource.Resource> getResources()
      • getElementById

        public java.lang.Object getElementById​(java.lang.String id)
      • getElementId

        public java.lang.String getElementId​(java.lang.Object instance)
      • setElementId

        public void setElementId​(java.lang.Object instance,
                                 java.lang.String newId)
      • getTypeOf

        public java.lang.Object getTypeOf​(java.lang.Object instance)
        Specified by:
        getTypeOf in interface IModel
        Overrides:
        getTypeOf in class Model
      • getTypeNameOf

        public java.lang.String getTypeNameOf​(java.lang.Object instance)
        Description copied from interface: IModel
        Returns a string representing the type of the instance object. The value returned by this function can be passed to createInstance to instantiate another object of the same type as instance.
        Parameters:
        instance - The model object whose type is to be determined.
        Returns:
        the name of the type of the model object, instance.
      • getFullyQualifiedTypeNameOf

        public java.lang.String getFullyQualifiedTypeNameOf​(java.lang.Object instance)
        Description copied from interface: IModel
        Returns a string representing the fully-qualified type of the instance object. The value returned by this function can be passed to createInstance to instantiate another object of the same type as instance.
        Specified by:
        getFullyQualifiedTypeNameOf in interface IModel
        Overrides:
        getFullyQualifiedTypeNameOf in class Model
        Parameters:
        instance - The model object whose type is to be determined.
        Returns:
        the name of the type of the model object, instance.
      • getAllTypeNamesOf

        public java.util.Collection<java.lang.String> getAllTypeNamesOf​(java.lang.Object instance)
        Description copied from class: CachedModel
        Returns the fully qualified names of every type to which the given object conforms. The values are used by by CachedModel for the memoization of model elements by their kind (CachedModel.getAllOfKind(String)).
        Specified by:
        getAllTypeNamesOf in class CachedModel<org.eclipse.emf.ecore.EObject>
      • isInstantiable

        public boolean isInstantiable​(java.lang.String type)
      • hasType

        public boolean hasType​(java.lang.String type)
      • hasAdapter

        protected boolean hasAdapter​(java.lang.Class<? extends org.eclipse.emf.ecore.util.EContentAdapter> adapterType)
        Determines whether this model has an adapter matching the specified type.
        Parameters:
        adapterType - The adapter class.
        Returns:
        true if this model's adapters contains the specified adapter type.
        Since:
        1.6
      • getFullyQualifiedName

        protected java.lang.String getFullyQualifiedName​(org.eclipse.emf.ecore.EClassifier eClassifier)
      • isModelElement

        public boolean isModelElement​(java.lang.Object instance)
        Description copied from interface: IModel
        Used to test whether a Java object can be contained by this model. For example, EMF models can contain instances of EObject, but not instances of just Object.
        Specified by:
        isModelElement in interface IModel
        Overrides:
        isModelElement in class Model
        Parameters:
        instance - the Java object to test.
        Returns:
        true if and only if instance can be contained by this model.
      • getContainerOf

        public java.lang.Object getContainerOf​(java.lang.Object object)
      • isExpand

        public boolean isExpand()
      • setExpand

        public void setExpand​(boolean expand)
      • setParallelAllOf

        public void setParallelAllOf​(boolean parallel)
        Parameters:
        parallel -
        Since:
        1.6
      • isParallelAllOf

        public boolean isParallelAllOf()
        Returns:
        Since:
        1.6
      • isLoaded

        public boolean isLoaded()
        Description copied from class: CachedModel
        Convenience method for determining when a model has been loaded.
        Overrides:
        isLoaded in class CachedModel<org.eclipse.emf.ecore.EObject>
        Returns:
        Whether the cache has been populated.
        Since:
        1.6