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.EObject
object
-
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 protected
ASMEMFModelElement(java.util.Map modelElements, ASMModel model, org.eclipse.emf.ecore.EObject object)
Creates a newASMEMFModelElement
with the given parameters.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static 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 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.ASMBoolean
conformsTo(ASMOclType other)
protected ASMOclAny
emf2ASM(StackFrame frame, java.lang.Object value)
Converts an EMF element to its ASM equivalent.protected void
finalize()
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.ASMOclAny
get(StackFrame frame, java.lang.String name)
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.static ASMOclAny
getInstanceById(StackFrame frame, ASMEMFModelElement self, ASMString modelName, ASMString id)
Returns the instance with the given id.org.eclipse.emf.ecore.EObject
getObject()
Returns the internal EObject.ASMModelElement
getProperty(java.lang.String name)
ASMModelElement
getPropertyType(java.lang.String name)
ASMOclAny
invoke(StackFrame frame, java.lang.String opName, java.util.List arguments)
Searches for Operation opName in this context and invokes it if found.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.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.ASMOclAny
refImmediateComposite()
void
set(StackFrame frame, java.lang.String name, ASMOclAny value)
void
unset(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 newASMEMFModelElement
with the given parameters.- Parameters:
modelElements
- the model elements mapmodel
- the model elementobject
- the object
-
-
Method Detail
-
conformsTo
public ASMBoolean conformsTo(ASMOclType other)
- Specified by:
conformsTo
in classASMModelElement
- See Also:
ASMModelElement.conformsTo(org.eclipse.m2m.atl.engine.vm.nativelib.ASMOclType)
-
getPropertyType
public ASMModelElement getPropertyType(java.lang.String name)
- Specified by:
getPropertyType
in classASMModelElement
- See Also:
ASMModelElement.getPropertyType(java.lang.String)
-
getProperty
public ASMModelElement getProperty(java.lang.String name)
- Specified by:
getProperty
in classASMModelElement
- See Also:
ASMModelElement.getProperty(java.lang.String)
-
refImmediateComposite
public ASMOclAny refImmediateComposite()
- Overrides:
refImmediateComposite
in classASMOclAny
- See Also:
ASMOclAny.refImmediateComposite()
-
get
public ASMOclAny get(StackFrame frame, java.lang.String name)
- Specified by:
get
in 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:
unset
in 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:
invoke
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:
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:
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:
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:
finalize
in classjava.lang.Object
- Throws:
java.lang.Throwable
- See Also:
Object.finalize()
-
-