public abstract class AbstractEmfModel extends CachedModel<org.eclipse.emf.ecore.EObject>
Modifier and Type | Field and Description |
---|---|
protected boolean |
expand |
protected org.eclipse.emf.ecore.resource.Resource |
modelImpl |
protected org.eclipse.emf.ecore.EPackage.Registry |
registry |
protected EmfModelTransactionSupport |
transactionSupport |
allContentsAreCached, allContentsCache, cachedKinds, cachedTypes, cachingEnabled, kindCache, PROPERTY_CACHED, typeCache
aliases, name, PROPERTY_ALIASES, PROPERTY_NAME, PROPERTY_READONLOAD, PROPERTY_STOREONDISPOSAL, readOnLoad, storeOnDisposal
Constructor and Description |
---|
AbstractEmfModel() |
Modifier and Type | Method and Description |
---|---|
void |
addMetamodelUri(String nsUri) |
protected Collection<org.eclipse.emf.ecore.EObject> |
allContentsFromModel() |
org.eclipse.emf.ecore.EClass |
classForName(String name) |
protected org.eclipse.emf.ecore.EClass |
classForName(String name,
boolean absolute,
Object pkg) |
protected org.eclipse.emf.ecore.EClass |
classForName(String name,
org.eclipse.emf.ecore.EPackage.Registry registry) |
protected org.eclipse.emf.ecore.EObject |
createInstanceInModel(String type) |
protected boolean |
deleteElementInModel(Object instance)
Returns true iff the given instance was deleted from the model.
|
void |
disposeModel() |
protected Collection<org.eclipse.emf.ecore.EObject> |
getAllOfKindFromModel(String kind) |
protected Collection<org.eclipse.emf.ecore.EObject> |
getAllOfTypeFromModel(String type) |
Collection<String> |
getAllTypeNamesOf(Object instance)
Returns the fully qualified names of every type to which the
given object conforms.
|
Object |
getCacheKeyForType(String type)
Returns an identity for the given type,
which will be used by
CachedModel
as a key for the memoization of model elements
by type. |
Object |
getContainerOf(Object object) |
Object |
getElementById(String id) |
String |
getElementId(Object instance) |
Object |
getEnumerationValue(String enumeration,
String label) |
protected String |
getFullyQualifiedName(org.eclipse.emf.ecore.EClassifier eClassifier) |
String |
getFullyQualifiedTypeNameOf(Object instance)
Returns a string representing the fully-qualified type of the instance object.
|
protected InputStream |
getInputStream(String file) |
org.eclipse.emf.ecore.resource.Resource |
getModelImpl()
Deprecated.
Use getResource() instead
|
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
|
IPropertyGetter |
getPropertyGetter() |
IPropertySetter |
getPropertySetter() |
org.eclipse.emf.ecore.resource.Resource |
getResource() |
protected List<org.eclipse.emf.ecore.resource.Resource> |
getResources() |
IModelTransactionSupport |
getTransactionSupport() |
String |
getTypeNameOf(Object instance)
Returns a string representing the type of the instance object.
|
Object |
getTypeOf(Object instance) |
boolean |
hasType(String type) |
protected int |
instancesCount(org.eclipse.emf.ecore.resource.Resource r) |
boolean |
isExpand() |
boolean |
isInstantiable(String type) |
boolean |
isModelElement(Object instance)
Used to test whether a Java object can be contained by this model.
|
boolean |
isOfKind(Object instance,
String metaClass) |
boolean |
isOfType(Object instance,
String metaClass) |
boolean |
isPropertySet(Object instance,
String property)
Returns
true if this instance has an explicit value for this property. |
protected boolean |
knowsAboutProperty(org.eclipse.emf.ecore.EObject instance,
String property) |
boolean |
knowsAboutProperty(Object instance,
String property)
Returns
true if this instance could have this property at some point. |
boolean |
owns(Object instance)
Used to test whether an object is contained in this model.
|
protected void |
setDataTypesInstanceClasses(org.eclipse.emf.ecore.resource.Resource metamodel) |
void |
setElementId(Object instance,
String newId) |
void |
setExpand(boolean expand) |
void |
setModelImpl(org.eclipse.emf.ecore.resource.Resource modelImpl) |
void |
setResource(org.eclipse.emf.ecore.resource.Resource resource) |
boolean |
store(OutputStream os) |
boolean |
store(String fileName) |
boolean |
store(org.eclipse.emf.common.util.URI uri) |
addToCache, allContents, clearCache, createInstance, deleteElement, dispose, getAllOfKind, getAllOfType, isCachingEnabled, load, load, loadModel, removeFromCache, setCachingEnabled
allInstances, createInstance, getAliases, getMetamodel, getName, isReadOnLoad, isStoredOnDisposal, load, load, setName, setReadOnLoad, setStoredOnDisposal
protected org.eclipse.emf.ecore.resource.Resource modelImpl
protected boolean expand
protected org.eclipse.emf.ecore.EPackage.Registry registry
protected EmfModelTransactionSupport transactionSupport
protected InputStream getInputStream(String file) throws IOException
IOException
protected void setDataTypesInstanceClasses(org.eclipse.emf.ecore.resource.Resource metamodel)
public void addMetamodelUri(String nsUri)
protected org.eclipse.emf.ecore.EPackage.Registry getPackageRegistry()
public Object getEnumerationValue(String enumeration, String label) throws EolEnumerationValueNotFoundException
public boolean knowsAboutProperty(Object instance, String property)
IModel
true
if this instance could have this property at some point.knowsAboutProperty
in interface IModel
knowsAboutProperty
in class Model
protected boolean knowsAboutProperty(org.eclipse.emf.ecore.EObject instance, String property)
public boolean isPropertySet(Object instance, String property) throws EolRuntimeException
IModel
true
if this instance has an explicit value for this property.
This would be equivalent to eIsSet in EMF.isPropertySet
in interface IModel
isPropertySet
in class Model
EolRuntimeException
protected Collection<org.eclipse.emf.ecore.EObject> getAllOfTypeFromModel(String type) throws EolModelElementTypeNotFoundException
getAllOfTypeFromModel
in class CachedModel<org.eclipse.emf.ecore.EObject>
EolModelElementTypeNotFoundException
public Object getCacheKeyForType(String type) throws EolModelElementTypeNotFoundException
CachedModel
CachedModel
as a key for the memoization of model elements
by type.getCacheKeyForType
in class CachedModel<org.eclipse.emf.ecore.EObject>
EolModelElementTypeNotFoundException
public org.eclipse.emf.ecore.EClass classForName(String name) throws EolModelElementTypeNotFoundException
protected org.eclipse.emf.ecore.EClass classForName(String name, org.eclipse.emf.ecore.EPackage.Registry registry)
protected org.eclipse.emf.ecore.EClass classForName(String name, boolean absolute, Object pkg)
protected Collection<org.eclipse.emf.ecore.EObject> getAllOfKindFromModel(String kind) throws EolModelElementTypeNotFoundException
getAllOfKindFromModel
in class CachedModel<org.eclipse.emf.ecore.EObject>
EolModelElementTypeNotFoundException
protected Collection<org.eclipse.emf.ecore.EObject> allContentsFromModel()
allContentsFromModel
in class CachedModel<org.eclipse.emf.ecore.EObject>
protected org.eclipse.emf.ecore.EObject createInstanceInModel(String type) throws EolModelElementTypeNotFoundException, EolNotInstantiableModelElementTypeException
createInstanceInModel
in class CachedModel<org.eclipse.emf.ecore.EObject>
EolModelElementTypeNotFoundException
EolNotInstantiableModelElementTypeException
public IModelTransactionSupport getTransactionSupport()
getTransactionSupport
in interface IModel
getTransactionSupport
in class Model
protected int instancesCount(org.eclipse.emf.ecore.resource.Resource r)
protected boolean deleteElementInModel(Object instance) throws EolRuntimeException
CachedModel
deleteElementInModel
in class CachedModel<org.eclipse.emf.ecore.EObject>
EolRuntimeException
public boolean owns(Object instance)
IModel
instance
- the Java object to test.public boolean store(String fileName)
public boolean store(org.eclipse.emf.common.util.URI uri)
public boolean store(OutputStream os)
public void disposeModel()
disposeModel
in class CachedModel<org.eclipse.emf.ecore.EObject>
public org.eclipse.emf.ecore.resource.Resource getResource()
public void setResource(org.eclipse.emf.ecore.resource.Resource resource)
public org.eclipse.emf.ecore.resource.Resource getModelImpl()
public void setModelImpl(org.eclipse.emf.ecore.resource.Resource modelImpl)
protected List<org.eclipse.emf.ecore.resource.Resource> getResources()
public IPropertyGetter getPropertyGetter()
getPropertyGetter
in interface IModel
getPropertyGetter
in class Model
public IPropertySetter getPropertySetter()
getPropertySetter
in interface IModel
getPropertySetter
in class Model
public String getTypeNameOf(Object instance)
IModel
instance
- The model object whose type is to be determined.public String getFullyQualifiedTypeNameOf(Object instance)
IModel
getFullyQualifiedTypeNameOf
in interface IModel
getFullyQualifiedTypeNameOf
in class Model
instance
- The model object whose type is to be determined.public Collection<String> getAllTypeNamesOf(Object instance)
CachedModel
CachedModel
for the memoization of
model elements by their kind (CachedModel.getAllOfKind(String)
).getAllTypeNamesOf
in class CachedModel<org.eclipse.emf.ecore.EObject>
public boolean isInstantiable(String type)
public boolean hasType(String type)
protected String getFullyQualifiedName(org.eclipse.emf.ecore.EClassifier eClassifier)
public boolean isModelElement(Object instance)
IModel
isModelElement
in interface IModel
isModelElement
in class Model
instance
- the Java object to test.public boolean isExpand()
public boolean isOfKind(Object instance, String metaClass) throws EolModelElementTypeNotFoundException
isOfKind
in interface IModel
isOfKind
in class Model
EolModelElementTypeNotFoundException
public boolean isOfType(Object instance, String metaClass) throws EolModelElementTypeNotFoundException
isOfType
in interface IModel
isOfType
in class Model
EolModelElementTypeNotFoundException
public void setExpand(boolean expand)
Copyright © 2018. All rights reserved.