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
public class ASMEMFModelElement extends ASMModelElement
The EMF implementation for ASMModelElement.
-
-
Field Summary
Fields Modifier and Type Field Description protected org.eclipse.emf.ecore.EObjectobject-
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
Constructors Modifier Constructor Description protectedASMEMFModelElement(java.util.Map modelElements, ASMModel model, org.eclipse.emf.ecore.EObject object)Creates a newASMEMFModelElementwith the given parameters.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ASMOrderedSetallInstances(StackFrame frame, ASMEMFModelElement self)Returns all instances of a type.static ASMOrderedSetallInstancesFrom(StackFrame frame, ASMEMFModelElement self, ASMString sourceModelName)Returns all instances of a type from a given model.protected java.lang.Objectasm2EMF(StackFrame frame, ASMOclAny value, java.lang.String propName, org.eclipse.emf.ecore.EStructuralFeature feature)Converts an ASM element to its EMF equivalent.ASMBooleanconformsTo(ASMOclType other)protected ASMOclAnyemf2ASM(StackFrame frame, java.lang.Object value)Converts an EMF element to its ASM equivalent.protected voidfinalize()protected java.lang.reflect.MethodfindMethod(java.lang.Class cls, java.lang.String name, java.lang.Class[] argumentTypes)Returns the method which match the given parameters.ASMOclAnyget(StackFrame frame, java.lang.String name)static org.eclipse.emf.ecore.EEnumLiteralgetEENumLiteral(org.eclipse.emf.ecore.EEnum eEnum, java.lang.String id)Returns the literal matching the given name or literal.static ASMOclAnygetInstanceById(StackFrame frame, ASMEMFModelElement self, ASMString modelName, ASMString id)Returns the instance with the given id.org.eclipse.emf.ecore.EObjectgetObject()Returns the internal EObject.ASMModelElementgetProperty(java.lang.String name)ASMModelElementgetPropertyType(java.lang.String name)ASMOclAnyinvoke(StackFrame frame, java.lang.String opName, java.util.List arguments)Searches for Operation opName in this context and invokes it if found.ASMOclAnyinvokeSuper(StackFrame frame, java.lang.String opName, java.util.List arguments)Searches for Operation opName in the superclass context and invokes it if found.static ASMModelElementnewInstance(StackFrame frame, ASMEMFModelElement self)Creates a new instance of a given type.static ASMModelElementnewInstanceIn(StackFrame frame, ASMEMFModelElement self, ASMString modelName)Creates a new instance of a given type.ASMOclAnyrefImmediateComposite()voidset(StackFrame frame, java.lang.String name, ASMOclAny value)voidunset(StackFrame frame, java.lang.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
-
-
-
-
Constructor Detail
-
ASMEMFModelElement
protected ASMEMFModelElement(java.util.Map modelElements, ASMModel model, org.eclipse.emf.ecore.EObject object)Creates a newASMEMFModelElementwith the given parameters.- Parameters:
modelElements- the model elements mapmodel- the model elementobject- the object
-
-
Method Detail
-
conformsTo
public ASMBoolean conformsTo(ASMOclType other)
- Specified by:
conformsToin classASMModelElement- See Also:
ASMModelElement.conformsTo(org.eclipse.m2m.atl.engine.vm.nativelib.ASMOclType)
-
getPropertyType
public ASMModelElement getPropertyType(java.lang.String name)
- Specified by:
getPropertyTypein classASMModelElement- See Also:
ASMModelElement.getPropertyType(java.lang.String)
-
getProperty
public ASMModelElement getProperty(java.lang.String name)
- Specified by:
getPropertyin classASMModelElement- See Also:
ASMModelElement.getProperty(java.lang.String)
-
refImmediateComposite
public ASMOclAny refImmediateComposite()
- Overrides:
refImmediateCompositein classASMOclAny- See Also:
ASMOclAny.refImmediateComposite()
-
get
public ASMOclAny get(StackFrame frame, java.lang.String name)
- Specified by:
getin classASMModelElement- See Also:
ASMModelElement.get(org.eclipse.m2m.atl.engine.vm.StackFrame, java.lang.String)
-
asm2EMF
protected java.lang.Object asm2EMF(StackFrame frame, ASMOclAny value, java.lang.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
protected ASMOclAny emf2ASM(StackFrame frame, java.lang.Object value)
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, java.lang.String id)Returns the literal matching the given name or literal.- Parameters:
eEnum- the enumerationid- the name or the literal- Returns:
- the literal
-
set
public void set(StackFrame frame, java.lang.String name, ASMOclAny value)
-
unset
public void unset(StackFrame frame, java.lang.String name)
- Overrides:
unsetin classASMOclAny- See Also:
ASMOclAny.unset(org.eclipse.m2m.atl.engine.vm.StackFrame, java.lang.String)
-
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
public static ASMOrderedSet allInstances(StackFrame frame, ASMEMFModelElement self)
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
public static ASMModelElement newInstance(StackFrame frame, ASMEMFModelElement self)
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
protected java.lang.reflect.Method findMethod(java.lang.Class cls, java.lang.String name, java.lang.Class[] argumentTypes)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
public ASMOclAny invoke(StackFrame frame, java.lang.String opName, java.util.List arguments)
Searches for Operation opName in this context and invokes it if found.- Overrides:
invokein 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:
ASMOclAny.invoke(org.eclipse.m2m.atl.engine.vm.StackFrame, java.lang.String, java.util.List)
-
invokeSuper
public ASMOclAny invokeSuper(StackFrame frame, java.lang.String opName, java.util.List arguments)
Searches for Operation opName in the superclass context and invokes it if found.- Overrides:
invokeSuperin 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:
ASMOclAny.invokeSuper(org.eclipse.m2m.atl.engine.vm.StackFrame, java.lang.String, java.util.List)
-
getObject
public org.eclipse.emf.ecore.EObject getObject()
Returns the internal EObject.- Returns:
- The internal EObject.
-
finalize
protected void finalize() throws java.lang.Throwable- Overrides:
finalizein classjava.lang.Object- Throws:
java.lang.Throwable- See Also:
Object.finalize()
-
-