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
Fields -
Constructor Summary
ConstructorsConstructorDescriptionEMFModel(EMFReferenceModel referenceModel, EMFModelFactory mf) Creates a newEMFModelconforming to the givenEMFReferenceModel. -
Method Summary
Modifier and TypeMethodDescriptionvoidFinalizes the model.protected voidfinalize()Set<org.eclipse.emf.ecore.EObject> getElementsByType(Object metaElement) Returns aSetof the elements matching the given type.Returns the ModelFactory used to create the current model.Returns theIReferenceModel(i.e.org.eclipse.emf.ecore.resource.ResourceReturns the resource.booleanReturns true if the given object is contained in this model's resource or a referenced resource.booleanisTarget()Defines if the model is readonly or not.newElement(Object metaElement) Creates a new element in the model.voidsetIsTarget(boolean value) Sets if the model is readonly or not.protected voidsetResource(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 newEMFModelconforming 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:
newElementin interfaceIModel- Parameters:
metaElement- the new element metatype- Returns:
- the newly created element
- See Also:
-
getReferenceModel
Returns theIReferenceModel(i.e. the metamodel).- Specified by:
getReferenceModelin interfaceIModel- Returns:
- the
IReferenceModel - See Also:
-
getElementsByType
Returns aSetof the elements matching the given type.- Specified by:
getElementsByTypein interfaceIModel- Parameters:
metaElement- a metatype- Returns:
- a
Setof 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:
setIsTargetin 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:
getModelFactoryin 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
-