Class EMFModelAdapter
java.lang.Object
org.eclipse.m2m.atl.engine.emfvm.adapter.EMFModelAdapter
- All Implemented Interfaces:
IModelAdapter
- Direct Known Subclasses:
UML2ModelAdapter
The model adapter dedicated to EMF.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
delete
(AbstractStackFrame frame, Object modelElement) Deletes an object on the given frame.void
finalizeModel
(IModel model) Finalizes the given model.get
(AbstractStackFrame frame, Object modelElement, String name) Gets a value from an object in the given frame.static org.eclipse.emf.ecore.EEnumLiteral
getEENumLiteral
(org.eclipse.emf.ecore.EEnum eEnum, String id) Returns the literal matching the given name or literal.Returns the element id.static Object
getNameOf
(org.eclipse.emf.ecore.EObject eo) Returns the name of an eObject.getSupertypes
(Object type) Returns the list of supertypes of a given type.Returns the type of a given element.Invokes a method.boolean
Checks if an elements has been deleted in refining mode and does not belong to any resource.boolean
isMetametaElement
(Object element) Returnstrue
if the given element is managed by the metametamodel of the current model adapter.boolean
Returnstrue
if the given object is managed by the current model adapter.boolean
prettyPrint
(ExecEnv execEnv, PrintStream out, Object value) Displays in a readable format the given object.void
registerVMSupertypes
(Map<Class<?>, List<Class<?>>> vmSupertypes) Registers a map of supertypes.void
Registers a map of operations.void
set
(AbstractStackFrame frame, Object modelElement, String name, Object value) Sets a value on an object in the given frame.void
setAllowInterModelReferences
(boolean allowInterModelRefs) Sets "allow inter-model references" for this model adapter.void
Sets the element id.void
unSet
(AbstractStackFrame frame, Object modelElement, String name) Unsets a value on an object in the given frame.
-
Constructor Details
-
EMFModelAdapter
public EMFModelAdapter()Creates an EMF model adapter.
-
-
Method Details
-
setAllowInterModelReferences
public void setAllowInterModelReferences(boolean allowInterModelRefs) Sets "allow inter-model references" for this model adapter.- Specified by:
setAllowInterModelReferences
in interfaceIModelAdapter
- Parameters:
allowInterModelRefs
- the parameter value
-
getNameOf
Returns the name of an eObject.- Parameters:
eo
- the eObject- Returns:
- the name of an eObject
-
getEENumLiteral
public static org.eclipse.emf.ecore.EEnumLiteral getEENumLiteral(org.eclipse.emf.ecore.EEnum eEnum, String id) Returns the literal matching the given name or literal.- Parameters:
eEnum
- the enumerationid
- the name or the literal- Returns:
- the literal
-
getSupertypes
Returns the list of supertypes of a given type.- Specified by:
getSupertypes
in interfaceIModelAdapter
- Parameters:
type
- the type- Returns:
- the list of supertypes
- See Also:
-
getType
Returns the type of a given element.- Specified by:
getType
in interfaceIModelAdapter
- Parameters:
value
- the type- Returns:
- the type
- See Also:
-
prettyPrint
Displays in a readable format the given object.- Specified by:
prettyPrint
in interfaceIModelAdapter
- Parameters:
execEnv
- the current execEnvout
- the output streamvalue
- the object to display- Returns:
- true if display has been successful
- See Also:
-
registerVMSupertypes
Registers a map of supertypes.- Specified by:
registerVMSupertypes
in interfaceIModelAdapter
- Parameters:
vmSupertypes
- the map- See Also:
-
registerVMTypeOperations
Registers a map of operations.- Specified by:
registerVMTypeOperations
in interfaceIModelAdapter
- Parameters:
vmTypeOperations
- the map- See Also:
-
get
Gets a value from an object in the given frame.- Specified by:
get
in interfaceIModelAdapter
- Parameters:
frame
- theAbstractStackFrame
modelElement
- the objectname
- the name of the attribute / feature which contains the value- Returns:
- the value
- See Also:
-
set
Sets a value on an object in the given frame.- Specified by:
set
in interfaceIModelAdapter
- Parameters:
frame
- theAbstractStackFrame
modelElement
- the objectname
- the name of the attribute / feature which will contain the valuevalue
- the value to set- See Also:
-
unSet
Unsets a value on an object in the given frame.- Specified by:
unSet
in interfaceIModelAdapter
- Parameters:
frame
- theAbstractStackFrame
modelElement
- the objectname
- the name of the attribute / feature which will contain the value- See Also:
-
delete
Deletes an object on the given frame.- Specified by:
delete
in interfaceIModelAdapter
- Parameters:
frame
- theAbstractStackFrame
modelElement
- the object to delete- See Also:
-
invoke
Invokes a method.- Specified by:
invoke
in interfaceIModelAdapter
- Parameters:
method
- the method to invokeself
- the object contextarguments
- the call arguments- Returns:
- the method result
- See Also:
-
finalizeModel
Finalizes the given model.- Specified by:
finalizeModel
in interfaceIModelAdapter
- Parameters:
model
- the given model- See Also:
-
getID
Returns the element id.- Specified by:
getID
in interfaceIModelAdapter
- Parameters:
element
- the element- Returns:
- the element id
- See Also:
-
isDeleted
Checks if an elements has been deleted in refining mode and does not belong to any resource.- Specified by:
isDeleted
in interfaceIModelAdapter
- Parameters:
element
- the element- Returns:
- ture if the element has been deleted. False otherwise.
- See Also:
-
setID
Sets the element id.- Specified by:
setID
in interfaceIModelAdapter
- Parameters:
element
- the elementid
- the id to set- See Also:
-
isModelElement
Returnstrue
if the given object is managed by the current model adapter.- Specified by:
isModelElement
in interfaceIModelAdapter
- Parameters:
o
- the given object- Returns:
true
if the given object is managed by the current model adapter- See Also:
-
isMetametaElement
Returnstrue
if the given element is managed by the metametamodel of the current model adapter.- Specified by:
isMetametaElement
in interfaceIModelAdapter
- Parameters:
element
- the given element- Returns:
true
if the given element is managed by the metametamodel of the current model adapter- See Also:
-