Class ASMEMFModelElement
java.lang.Object
org.eclipse.m2m.atl.engine.vm.nativelib.ASMNativeObject
org.eclipse.m2m.atl.engine.vm.nativelib.ASMOclAny
org.eclipse.m2m.atl.engine.vm.nativelib.ASMOclType
org.eclipse.m2m.atl.engine.vm.nativelib.ASMModelElement
org.eclipse.m2m.atl.drivers.emf4atl.ASMEMFModelElement
- Direct Known Subclasses:
ASMUMLModelElement
The EMF implementation for ASMModelElement.
-
Field Summary
Fields inherited from class org.eclipse.m2m.atl.engine.vm.nativelib.ASMOclType
myType
Fields inherited from class org.eclipse.m2m.atl.engine.vm.nativelib.ASMNativeObject
nativeImpl
-
Constructor Summary
ModifierConstructorDescriptionprotected
ASMEMFModelElement
(Map modelElements, ASMModel model, org.eclipse.emf.ecore.EObject object) Creates a newASMEMFModelElement
with the given parameters. -
Method Summary
Modifier and TypeMethodDescriptionstatic ASMOrderedSet
allInstances
(StackFrame frame, ASMEMFModelElement self) Returns all instances of a type.static ASMOrderedSet
allInstancesFrom
(StackFrame frame, ASMEMFModelElement self, ASMString sourceModelName) Returns all instances of a type from a given model.protected Object
asm2EMF
(StackFrame frame, ASMOclAny value, String propName, org.eclipse.emf.ecore.EStructuralFeature feature) Converts an ASM element to its EMF equivalent.conformsTo
(ASMOclType other) protected ASMOclAny
emf2ASM
(StackFrame frame, Object value) Converts an EMF element to its ASM equivalent.protected void
finalize()
protected Method
findMethod
(Class cls, String name, Class[] argumentTypes) Returns the method which match the given parameters.get
(StackFrame frame, String name) static org.eclipse.emf.ecore.EEnumLiteral
getEENumLiteral
(org.eclipse.emf.ecore.EEnum eEnum, String id) Returns the literal matching the given name or literal.static ASMOclAny
getInstanceById
(StackFrame frame, ASMEMFModelElement self, ASMString modelName, ASMString id) Returns the instance with the given id.org.eclipse.emf.ecore.EObject
Returns the internal EObject.getProperty
(String name) getPropertyType
(String name) invoke
(StackFrame frame, String opName, List arguments) Searches for Operation opName in this context and invokes it if found.invokeSuper
(StackFrame frame, String opName, List arguments) Searches for Operation opName in the superclass context and invokes it if found.static ASMModelElement
newInstance
(StackFrame frame, ASMEMFModelElement self) Creates a new instance of a given type.static ASMModelElement
newInstanceIn
(StackFrame frame, ASMEMFModelElement self, ASMString modelName) Creates a new instance of a given type.void
set
(StackFrame frame, String name, ASMOclAny value) void
unset
(StackFrame frame, String name) Methods inherited from class org.eclipse.m2m.atl.engine.vm.nativelib.ASMModelElement
createNewInstance, getAcquaintance, getMetaobject, getModel, getName, lookupElementExtended, otherEnd, setMetaobject, setName, toString
Methods inherited from class org.eclipse.m2m.atl.engine.vm.nativelib.ASMOclType
addSupertype, conformsTo, getName, getSupertypes, getVMOperations, registerHelperAttribute, registerVMOperation, registerWeavingHelper
Methods inherited from class org.eclipse.m2m.atl.engine.vm.nativelib.ASMOclAny
asBag, asSequence, asSet, check, debug, findOperation, findOperation, getHelper, getNamedTargetFromSource, getOclAnyType, getType, invoke, isHelper, oclIsKindOf, oclIsTypeOf, oclIsUndefined, oclType, operatorEQ, operatorNE, output, refGetValue, refImmediateComposite, refInvokeOperation, refSetValue, refUnsetValue, setType, toString
Methods inherited from class org.eclipse.m2m.atl.engine.vm.nativelib.ASMNativeObject
getNativeImpl
-
Field Details
-
object
protected org.eclipse.emf.ecore.EObject object
-
-
Constructor Details
-
ASMEMFModelElement
protected ASMEMFModelElement(Map modelElements, ASMModel model, org.eclipse.emf.ecore.EObject object) Creates a newASMEMFModelElement
with the given parameters.- Parameters:
modelElements
- the model elements mapmodel
- the model elementobject
- the object
-
-
Method Details
-
conformsTo
- Specified by:
conformsTo
in classASMModelElement
- See Also:
-
getPropertyType
- Specified by:
getPropertyType
in classASMModelElement
- See Also:
-
getProperty
- Specified by:
getProperty
in classASMModelElement
- See Also:
-
refImmediateComposite
- Overrides:
refImmediateComposite
in classASMOclAny
- See Also:
-
get
- Specified by:
get
in classASMModelElement
- See Also:
-
asm2EMF
protected Object asm2EMF(StackFrame frame, ASMOclAny value, String propName, org.eclipse.emf.ecore.EStructuralFeature feature) Converts an ASM element to its EMF equivalent.- Parameters:
frame
- the frame contextvalue
- the element to convertpropName
- the property namefeature
- the feature which refers to the element- Returns:
- the converted element
-
emf2ASM
Converts an EMF element to its ASM equivalent.- Parameters:
frame
- the frame contextvalue
- the element to convert- Returns:
- the converted element
-
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
-
set
-
unset
-
getInstanceById
public static ASMOclAny getInstanceById(StackFrame frame, ASMEMFModelElement self, ASMString modelName, ASMString id) Returns the instance with the given id. For testing purpose.- Parameters:
frame
- the frame contextself
- the current elementmodelName
- the model nameid
- the instance id- Returns:
- the instance
-
allInstances
Returns all instances of a type.- Parameters:
frame
- the frame contextself
- the caller type- Returns:
- all instances of a type
-
allInstancesFrom
public static ASMOrderedSet allInstancesFrom(StackFrame frame, ASMEMFModelElement self, ASMString sourceModelName) Returns all instances of a type from a given model. TODO: return type could be a Set because there is no order, in theory However, keeping resource (i.e., XMI) order is sometimes less confusing- Parameters:
frame
- the frame contextself
- the caller typesourceModelName
- the model name- Returns:
- all instances of a type from a given model
-
newInstance
Creates a new instance of a given type.- Parameters:
frame
- the frame contextself
- the given type- Returns:
- the new element
-
newInstanceIn
public static ASMModelElement newInstanceIn(StackFrame frame, ASMEMFModelElement self, ASMString modelName) Creates a new instance of a given type.- Parameters:
frame
- the frame contextself
- the given typemodelName
- the model where to create the element- Returns:
- the new element
-
findMethod
Returns the method which match the given parameters.- Parameters:
cls
- the class which contains the methodname
- the method nameargumentTypes
- th method parameters- Returns:
- the method
-
invoke
Searches for Operation opName in this context and invokes it if found. -
invokeSuper
Searches for Operation opName in the superclass context and invokes it if found.- Overrides:
invokeSuper
in classASMOclAny
- Parameters:
frame
- The current stack frameopName
- The Operation's namearguments
- The operation arguments, excluding self- Returns:
- The Operation's result or null
- See Also:
-
getObject
public org.eclipse.emf.ecore.EObject getObject()Returns the internal EObject.- Returns:
- The internal EObject.
-
finalize
-