Package org.eclipse.m2m.atl.core.emf
Class EMFModel
java.lang.Object
org.eclipse.m2m.atl.core.emf.EMFModel
- All Implemented Interfaces:
IModel
- Direct Known Subclasses:
AtlResourceImpl.EMFModelWrapper
,EMFReferenceModel
The EMF implementation of
IModel
.-
Field Summary
-
Constructor Summary
ConstructorDescriptionEMFModel
(EMFReferenceModel referenceModel, EMFModelFactory mf) Creates a newEMFModel
conforming to the givenEMFReferenceModel
. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Finalizes the model.protected void
finalize()
Set<org.eclipse.emf.ecore.EObject>
getElementsByType
(Object metaElement) Returns aSet
of the elements matching the given type.Returns the ModelFactory used to create the current model.Returns theIReferenceModel
(i.e.org.eclipse.emf.ecore.resource.Resource
Returns the resource.boolean
Returns true if the given object is contained in this model's resource or a referenced resource.boolean
isTarget()
Defines if the model is readonly or not.newElement
(Object metaElement) Creates a new element in the model.void
setIsTarget
(boolean value) Sets if the model is readonly or not.protected void
setResource
(org.eclipse.emf.ecore.resource.Resource resource) Sets the resource with the resource value.
-
Field Details
-
referenceModel
The metamodel. -
elementsByType
-
-
Constructor Details
-
EMFModel
Creates a newEMFModel
conforming to the givenEMFReferenceModel
.- Parameters:
referenceModel
- the metamodel.mf
- the model factory that is creating this model.
-
-
Method Details
-
newElement
Creates a new element in the model.- Specified by:
newElement
in interfaceIModel
- Parameters:
metaElement
- the new element metatype- Returns:
- the newly created element
- See Also:
-
getReferenceModel
Returns theIReferenceModel
(i.e. the metamodel).- Specified by:
getReferenceModel
in interfaceIModel
- Returns:
- the
IReferenceModel
- See Also:
-
getElementsByType
Returns aSet
of the elements matching the given type.- Specified by:
getElementsByType
in interfaceIModel
- Parameters:
metaElement
- a metatype- Returns:
- a
Set
of the elements matching the given type - See Also:
-
isTarget
public boolean isTarget()Defines if the model is readonly or not. -
setIsTarget
public void setIsTarget(boolean value) Sets if the model is readonly or not.- Specified by:
setIsTarget
in interfaceIModel
- Parameters:
value
- true if the model allows writing- See Also:
-
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
-
getModelFactory
Returns the ModelFactory used to create the current model.- Specified by:
getModelFactory
in interfaceIModel
- Returns:
- true if the model allows writing
- See Also:
-
commitToResource
public void commitToResource()Finalizes the model. -
isModelOf
Returns true if the given object is contained in this model's resource or a referenced resource. -
finalize
-