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
The EMF implementation of
IReferenceModel
.-
Field Summary
Fields inherited from class org.eclipse.m2m.atl.core.emf.EMFModel
elementsByType, referenceModel
-
Constructor Summary
ConstructorDescriptionEMFReferenceModel
(EMFReferenceModel referenceModel, EMFModelFactory mf) Creates a newEMFReferenceModel
. -
Method Summary
Modifier and TypeMethodDescriptionprotected void
addAllReferencedResources
(org.eclipse.emf.ecore.resource.Resource resource) Searches for and adds all resources that are referenced from the main resource to referencedResources.Set<org.eclipse.emf.ecore.EObject>
getAllElementsByType
(org.eclipse.emf.ecore.EClass metaElement) Returns aSet
of the elements matching the given type, including elements ingetReferencedResources()
.getMetaElementByName
(String name) Returns the metaelement having the given name.Set<org.eclipse.emf.ecore.resource.Resource>
Returns the referencedResources.boolean
Returns true if the given object is contained in this model's resource or a referenced resource.void
register()
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 Details
-
EMFReferenceModel
Creates a newEMFReferenceModel
.- Parameters:
referenceModel
- the metamodel.mf
- the model factory that is creating this model.
-
-
Method Details
-
getMetaElementByName
Returns the metaelement having the given name.- Specified by:
getMetaElementByName
in interfaceIReferenceModel
- Parameters:
name
- the given name- Returns:
- the metaelement having the given name
- See Also:
-
isModelOf
Returns true if the given object is contained in this model's resource or a referenced resource. -
getAllElementsByType
public Set<org.eclipse.emf.ecore.EObject> getAllElementsByType(org.eclipse.emf.ecore.EClass metaElement) Returns aSet
of the elements matching the given type, including elements ingetReferencedResources()
.- Parameters:
metaElement
- a metatype- Returns:
- a
Set
of the elements matching the given type - See Also:
-
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
Returns the referencedResources.- Returns:
- the referencedResources
-