Package org.eclipse.m2m.atl.core.emf
Class EMFReferenceModel
- java.lang.Object
-
- org.eclipse.m2m.atl.core.emf.EMFModel
-
- org.eclipse.m2m.atl.core.emf.EMFReferenceModel
-
- All Implemented Interfaces:
IModel,IReferenceModel
public class EMFReferenceModel extends EMFModel implements IReferenceModel
The EMF implementation ofIReferenceModel.
-
-
Field Summary
-
Fields inherited from class org.eclipse.m2m.atl.core.emf.EMFModel
elementsByType, referenceModel
-
-
Constructor Summary
Constructors Constructor Description EMFReferenceModel(EMFReferenceModel referenceModel, EMFModelFactory mf)Creates a newEMFReferenceModel.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaddAllReferencedResources(org.eclipse.emf.ecore.resource.Resource resource)Searches for and adds all resources that are referenced from the main resource to referencedResources.java.util.Set<org.eclipse.emf.ecore.EObject>getAllElementsByType(org.eclipse.emf.ecore.EClass metaElement)Returns aSetof the elements matching the given type, including elements ingetReferencedResources().java.lang.ObjectgetMetaElementByName(java.lang.String name)Returns the metaelement having the given name.java.util.Set<org.eclipse.emf.ecore.resource.Resource>getReferencedResources()Returns the referencedResources.booleanisModelOf(java.lang.Object object)Returns true if the given object is contained in this model's resource or a referenced resource.voidregister()Registers EMF Packages.-
Methods inherited from class org.eclipse.m2m.atl.core.emf.EMFModel
commitToResource, finalize, getElementsByType, getModelFactory, getReferenceModel, getResource, isTarget, newElement, setIsTarget, setResource
-
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.eclipse.m2m.atl.core.IModel
getElementsByType, getModelFactory, getReferenceModel, isTarget, newElement, setIsTarget
-
-
-
-
Constructor Detail
-
EMFReferenceModel
public EMFReferenceModel(EMFReferenceModel referenceModel, EMFModelFactory mf)
Creates a newEMFReferenceModel.- Parameters:
referenceModel- the metamodel.mf- the model factory that is creating this model.
-
-
Method Detail
-
getMetaElementByName
public java.lang.Object getMetaElementByName(java.lang.String name)
Returns the metaelement having the given name.- Specified by:
getMetaElementByNamein interfaceIReferenceModel- Parameters:
name- the given name- Returns:
- the metaelement having the given name
- See Also:
IReferenceModel.getMetaElementByName(java.lang.String)
-
isModelOf
public boolean isModelOf(java.lang.Object object)
Returns true if the given object is contained in this model's resource or a referenced resource.- Specified by:
isModelOfin interfaceIModel- Overrides:
isModelOfin classEMFModel- Parameters:
object- the model element- Returns:
- true if object is contained in this model's resource or a referenced resource
- See Also:
IModel.isModelOf(java.lang.Object)
-
getAllElementsByType
public java.util.Set<org.eclipse.emf.ecore.EObject> getAllElementsByType(org.eclipse.emf.ecore.EClass metaElement)
Returns aSetof the elements matching the given type, including elements ingetReferencedResources().- Parameters:
metaElement- a metatype- Returns:
- a
Setof the elements matching the given type - See Also:
IModel.getElementsByType(java.lang.Object)
-
register
public void register()
Registers EMF Packages.
-
addAllReferencedResources
protected void addAllReferencedResources(org.eclipse.emf.ecore.resource.Resource resource)
Searches for and adds all resources that are referenced from the main resource to referencedResources.- Parameters:
resource- the main resource
-
getReferencedResources
public java.util.Set<org.eclipse.emf.ecore.resource.Resource> getReferencedResources()
Returns the referencedResources.- Returns:
- the referencedResources
-
-