public class EmfModel extends AbstractEmfModel implements IReflectiveModel
Modifier and Type | Field and Description |
---|---|
protected static Map<String,List<org.eclipse.emf.ecore.EPackage>> |
fileBasedMetamodels |
protected static Map<String,Long> |
fileBasedMetamodelTimestamps |
protected boolean |
isMetamodelFileBased |
protected List<org.eclipse.emf.common.util.URI> |
metamodelFileUris |
protected List<org.eclipse.emf.common.util.URI> |
metamodelUris |
protected org.eclipse.emf.common.util.URI |
modelUri |
protected List<org.eclipse.emf.ecore.EPackage> |
packages |
static String |
PROPERTY_EXPAND
One of the keys used to construct the first argument to
Model.load(StringProperties, String) . |
static String |
PROPERTY_FILE_BASED_METAMODEL_URI
One of the keys used to construct the first argument to
Model.load(StringProperties, String) . |
static String |
PROPERTY_IS_METAMODEL_FILE_BASED
Deprecated.
PROPERTY_METAMODEL_URI and PROPERTY_FILE_BASED_METAMODEL_URI are now
interpreted as comma-separated lists of 0+ metamodel locations, and it is allowed to mix both types
of metamodels now. This property is no longer used. |
static String |
PROPERTY_METAMODEL_FILE
Deprecated.
Replaced by
PROPERTY_FILE_BASED_METAMODEL_URI .
This property will be removed in a future release of Epsilon. |
static String |
PROPERTY_METAMODEL_URI
One of the keys used to construct the first argument to
Model.load(StringProperties, String) . |
static String |
PROPERTY_MODEL_FILE
Deprecated.
Replaced by
PROPERTY_MODEL_URI .
This property will be removed in a future release of Epsilon. |
static String |
PROPERTY_MODEL_URI
One of the keys used to construct the first argument to
Model.load(StringProperties, String) . |
static String |
PROPERTY_REUSE_UNMODIFIED_FILE_BASED_METAMODELS
One of the keys used to construct the first argument to
Model.load(StringProperties, String) . |
protected boolean |
reuseUnmodifiedFileBasedMetamodels |
protected boolean |
useExtendedMetadata |
expand, modelImpl, registry, 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 |
---|
EmfModel() |
Modifier and Type | Method and Description |
---|---|
protected org.eclipse.emf.ecore.resource.ResourceSet |
createResourceSet() |
protected void |
determinePackagesFrom(org.eclipse.emf.ecore.resource.ResourceSet resourceSet) |
String |
getEnumerationLabelOf(Object literal)
Returns the enumeration label of the literal parameter.
|
String |
getEnumerationTypeOf(Object literal)
Returns the name of the enumeration type of the literal parameter.
|
Metamodel |
getMetamodel(StringProperties properties,
IRelativePathResolver resolver) |
List<String> |
getMetamodelFiles() |
List<org.eclipse.emf.common.util.URI> |
getMetamodelFileUris() |
List<String> |
getMetamodelUris() |
String |
getModelFile() |
org.eclipse.emf.common.util.URI |
getModelFileUri() |
Collection<String> |
getPropertiesOf(String type)
Returns a collection containing all of the properties that instances
of type know about.
|
IReflectivePropertySetter |
getPropertySetter() |
boolean |
hasPackage(String packageName)
Returns true iff this model contains a package with the given name.
|
boolean |
hasProperty(String type,
String property) |
boolean |
isEnumerationValue(Object object)
Returns true iff object is an enumeration value.
|
boolean |
isMetamodelFileBased()
Deprecated.
This value is no longer used to load models: it is only
kept for backwards compatibility, and it now simply indicates whether
a file metamodel was loaded at all, or not.
|
boolean |
isReuseUnmodifiedFileBasedMetamodels() |
void |
load(StringProperties properties,
IRelativePathResolver resolver)
Load the model using the set of properties specified by the first argument.
|
protected void |
loadModel() |
void |
loadModelFromUri() |
boolean |
preventLoadingOfExternalModelElements()
Prevents the loading of model elements that are referenced by
this model but are not contained in this model.
|
void |
setMetamodelFile(String path) |
void |
setMetamodelFileBased(boolean isMetamodelFileBased)
Deprecated.
This value is no longer honored anymore. Please populate the
lists in
getMetamodelUris() (URI-based metamodels)
and getMetamodelFileUris() (file-based metamodels)
appropriately instead. |
void |
setMetamodelFiles(List<String> paths) |
void |
setMetamodelFileUri(org.eclipse.emf.common.util.URI uri) |
void |
setMetamodelFileUris(List<org.eclipse.emf.common.util.URI> fileUris) |
void |
setMetamodelUri(String uri) |
void |
setMetamodelUris(List<String> uris) |
void |
setModelFile(String path) |
void |
setModelFileUri(org.eclipse.emf.common.util.URI modelFileUri) |
void |
setReuseUnmodifiedFileBasedMetamodels(boolean reuseUnmodifiedFileBasedMetamodels) |
void |
setupContainmentChangeListeners() |
boolean |
store() |
String |
toString() |
addMetamodelUri, allContentsFromModel, classForName, classForName, classForName, createInstanceInModel, deleteElementInModel, disposeModel, getAllOfKindFromModel, getAllOfTypeFromModel, getAllTypeNamesOf, getCacheKeyForType, getContainerOf, getElementById, getElementId, getEnumerationValue, getFullyQualifiedName, getFullyQualifiedTypeNameOf, getInputStream, getModelImpl, getPackageRegistry, getPropertyGetter, getResource, getResources, getTransactionSupport, getTypeNameOf, getTypeOf, hasType, instancesCount, isExpand, isInstantiable, isModelElement, isOfKind, isOfType, isPropertySet, knowsAboutProperty, knowsAboutProperty, owns, setDataTypesInstanceClasses, setElementId, setExpand, setModelImpl, setResource, store, store, store
allContents, clearCache, createInstance, deleteElement, dispose, getAllOfKind, getAllOfType, isCachingEnabled, load, setCachingEnabled
allInstances, createInstance, getAliases, getName, isReadOnLoad, isStoredOnDisposal, load, load, setName, setReadOnLoad, setStoredOnDisposal
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getContainerOf
allContents, createInstance, createInstance, deleteElement, dispose, getAliases, getAllOfKind, getAllOfType, getElementById, getElementId, getEnumerationValue, getFullyQualifiedTypeNameOf, getName, getPropertyGetter, getTransactionSupport, getTypeNameOf, getTypeOf, hasType, isInstantiable, isModelElement, isOfKind, isOfType, isPropertySet, isReadOnLoad, isStoredOnDisposal, knowsAboutProperty, load, load, load, owns, setElementId, setName, setReadOnLoad, setStoredOnDisposal, store
public static final String PROPERTY_EXPAND
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.@Deprecated public static final String PROPERTY_IS_METAMODEL_FILE_BASED
PROPERTY_METAMODEL_URI
and PROPERTY_FILE_BASED_METAMODEL_URI
are now
interpreted as comma-separated lists of 0+ metamodel locations, and it is allowed to mix both types
of metamodels now. This property is no longer used.public static final String PROPERTY_METAMODEL_URI
Model.load(StringProperties, String)
.
This key is a comma-separated list of zero or more namespaces URI of some of the metamodels to which
this model conforms. Users may combine this key with PROPERTY_FILE_BASED_METAMODEL_URI
to load
both file-based and URI-based metamodels at the same time.public static final String PROPERTY_FILE_BASED_METAMODEL_URI
Model.load(StringProperties, String)
.
This key is a comma-separated list of zero or more URI
s that can be used to locate some of the
metamodels to which this model conforms. Users may combine this key with PROPERTY_METAMODEL_URI
to load both file-based and URI-based metamodels at the same time.@Deprecated public static final String PROPERTY_METAMODEL_FILE
PROPERTY_FILE_BASED_METAMODEL_URI
.
This property will be removed in a future release of Epsilon.public static final String PROPERTY_MODEL_URI
Model.load(StringProperties, String)
.
This key is paired with a URI
that can be used to locate this model.
This key must always be paired with a value.@Deprecated public static final String PROPERTY_MODEL_FILE
PROPERTY_MODEL_URI
.
This property will be removed in a future release of Epsilon.public static final String PROPERTY_REUSE_UNMODIFIED_FILE_BASED_METAMODELS
Model.load(StringProperties, String)
.
This key is a Boolean value that if set to true
(the
default), tries to reuse previously registered file-based EPackages that
have not been modified since the last time they were registered.protected List<org.eclipse.emf.common.util.URI> metamodelUris
protected List<org.eclipse.emf.ecore.EPackage> packages
protected boolean isMetamodelFileBased
protected org.eclipse.emf.common.util.URI modelUri
protected List<org.eclipse.emf.common.util.URI> metamodelFileUris
protected boolean useExtendedMetadata
protected boolean reuseUnmodifiedFileBasedMetamodels
protected static Map<String,List<org.eclipse.emf.ecore.EPackage>> fileBasedMetamodels
public Collection<String> getPropertiesOf(String type) throws EolModelElementTypeNotFoundException
IReflectiveModel
getPropertiesOf
in interface IReflectiveModel
type
- The type of model object whose properties are to be determined.EolModelElementTypeNotFoundException
- when this model has no such typepublic boolean preventLoadingOfExternalModelElements()
IReflectiveModel
preventLoadingOfExternalModelElements
in interface IReflectiveModel
public void load(StringProperties properties, IRelativePathResolver resolver) throws EolModelLoadingException
load
in interface IModel
load
in class CachedModel<org.eclipse.emf.ecore.EObject>
EolModelLoadingException
PROPERTY_MODEL_URI
,
PROPERTY_IS_METAMODEL_FILE_BASED
,
PROPERTY_EXPAND
,
Rationale for deprecating the FILE properties.protected void loadModel() throws EolModelLoadingException
loadModel
in class CachedModel<org.eclipse.emf.ecore.EObject>
EolModelLoadingException
public void setupContainmentChangeListeners()
protected org.eclipse.emf.ecore.resource.ResourceSet createResourceSet()
public void loadModelFromUri() throws EolModelLoadingException
EolModelLoadingException
@Deprecated public boolean isMetamodelFileBased()
@Deprecated public void setMetamodelFileBased(boolean isMetamodelFileBased)
getMetamodelUris()
(URI-based metamodels)
and getMetamodelFileUris()
(file-based metamodels)
appropriately instead.public String getModelFile()
public org.eclipse.emf.common.util.URI getModelFileUri()
public void setModelFileUri(org.eclipse.emf.common.util.URI modelFileUri)
public List<org.eclipse.emf.common.util.URI> getMetamodelFileUris()
public void setMetamodelFileUris(List<org.eclipse.emf.common.util.URI> fileUris)
public void setMetamodelFileUri(org.eclipse.emf.common.util.URI uri)
public void setMetamodelUri(String uri)
public void setMetamodelFile(String path)
public void setModelFile(String path)
public boolean isReuseUnmodifiedFileBasedMetamodels()
public void setReuseUnmodifiedFileBasedMetamodels(boolean reuseUnmodifiedFileBasedMetamodels)
public IReflectivePropertySetter getPropertySetter()
getPropertySetter
in interface IModel
getPropertySetter
in interface IReflectiveModel
getPropertySetter
in class AbstractEmfModel
public boolean hasProperty(String type, String property) throws EolModelElementTypeNotFoundException
hasProperty
in interface IReflectiveModel
EolModelElementTypeNotFoundException
public boolean isEnumerationValue(Object object)
IReflectiveModel
isEnumerationValue
in interface IReflectiveModel
public String getEnumerationTypeOf(Object literal) throws EolNotAnEnumerationValueException
IReflectiveModel
getEnumerationTypeOf
in interface IReflectiveModel
EolNotAnEnumerationValueException
- when literal is not an enumeration valuepublic String getEnumerationLabelOf(Object literal) throws EolNotAnEnumerationValueException
IReflectiveModel
getEnumerationLabelOf
in interface IReflectiveModel
EolNotAnEnumerationValueException
- when literal is not an enumeration valueprotected void determinePackagesFrom(org.eclipse.emf.ecore.resource.ResourceSet resourceSet) throws EolModelLoadingException
EolModelLoadingException
public boolean hasPackage(String packageName)
IReflectiveModel
hasPackage
in interface IReflectiveModel
public Metamodel getMetamodel(StringProperties properties, IRelativePathResolver resolver)
getMetamodel
in interface IModel
getMetamodel
in class Model
Copyright © 2016. All rights reserved.