Interface IModelAdapter
-
- All Known Implementing Classes:
EMFModelAdapter,UML2ModelAdapter
public interface IModelAdapterThe EMFVM execution interface. Defines a set of methods dedicated to the execution of transformations.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voiddelete(AbstractStackFrame frame, java.lang.Object eo)Deletes an object on the given frame.voidfinalizeModel(IModel model)Finalizes the given model.java.lang.Objectget(AbstractStackFrame frame, java.lang.Object eo, java.lang.String name)Gets a value from an object in the given frame.java.lang.ObjectgetID(java.lang.Object element)Returns the element id.java.util.List<java.lang.Object>getSupertypes(java.lang.Object type)Returns the list of supertypes of a given type.java.lang.ObjectgetType(java.lang.Object value)Returns the type of a given element.java.lang.Objectinvoke(java.lang.reflect.Method method, java.lang.Object self, java.lang.Object[] arguments)Invokes a method.booleanisDeleted(java.lang.Object element)Checks if an elements has been deleted in refining mode and does not belong to any resource.booleanisMetametaElement(java.lang.Object element)Returnstrueif the given element is managed by the metametamodel of the current model adapter.booleanisModelElement(java.lang.Object o)Returnstrueif the given object is managed by the current model adapter.booleanprettyPrint(ExecEnv execEnv, java.io.PrintStream out, java.lang.Object value)Displays in a readable format the given object.voidregisterVMSupertypes(java.util.Map<java.lang.Class<?>,java.util.List<java.lang.Class<?>>> vmSupertypes)Registers a map of supertypes.voidregisterVMTypeOperations(java.util.Map<java.lang.Object,java.util.Map<java.lang.String,Operation>> vmTypeOperations)Registers a map of operations.voidset(AbstractStackFrame frame, java.lang.Object eo, java.lang.String name, java.lang.Object value)Sets a value on an object in the given frame.voidsetAllowInterModelReferences(boolean allowInterModelRefs)Sets "allow inter-model references" for this model adapter.voidsetID(java.lang.Object element, java.lang.Object id)Sets the element id.voidunSet(AbstractStackFrame frame, java.lang.Object eo, java.lang.String name)Unsets a value on an object in the given frame.
-
-
-
Method Detail
-
get
java.lang.Object get(AbstractStackFrame frame, java.lang.Object eo, java.lang.String name)
Gets a value from an object in the given frame.- Parameters:
frame- theAbstractStackFrameeo- the objectname- the name of the attribute / feature which contains the value- Returns:
- the value
-
set
void set(AbstractStackFrame frame, java.lang.Object eo, java.lang.String name, java.lang.Object value)
Sets a value on an object in the given frame.- Parameters:
frame- theAbstractStackFrameeo- the objectname- the name of the attribute / feature which will contain the valuevalue- the value to set
-
unSet
void unSet(AbstractStackFrame frame, java.lang.Object eo, java.lang.String name)
Unsets a value on an object in the given frame.- Parameters:
frame- theAbstractStackFrameeo- the objectname- the name of the attribute / feature which will contain the value
-
delete
void delete(AbstractStackFrame frame, java.lang.Object eo)
Deletes an object on the given frame.- Parameters:
frame- theAbstractStackFrameeo- the object to delete
-
registerVMSupertypes
void registerVMSupertypes(java.util.Map<java.lang.Class<?>,java.util.List<java.lang.Class<?>>> vmSupertypes)
Registers a map of supertypes.- Parameters:
vmSupertypes- the map
-
registerVMTypeOperations
void registerVMTypeOperations(java.util.Map<java.lang.Object,java.util.Map<java.lang.String,Operation>> vmTypeOperations)
Registers a map of operations.- Parameters:
vmTypeOperations- the map
-
prettyPrint
boolean prettyPrint(ExecEnv execEnv, java.io.PrintStream out, java.lang.Object value)
Displays in a readable format the given object.- Parameters:
execEnv- the current execEnvout- the output streamvalue- the object to display- Returns:
- true if display has been successful
-
getType
java.lang.Object getType(java.lang.Object value)
Returns the type of a given element.- Parameters:
value- the type- Returns:
- the type
-
getSupertypes
java.util.List<java.lang.Object> getSupertypes(java.lang.Object type)
Returns the list of supertypes of a given type.- Parameters:
type- the type- Returns:
- the list of supertypes
-
setAllowInterModelReferences
void setAllowInterModelReferences(boolean allowInterModelRefs)
Sets "allow inter-model references" for this model adapter.- Parameters:
allowInterModelRefs- true if intermodel references are allowed
-
invoke
java.lang.Object invoke(java.lang.reflect.Method method, java.lang.Object self, java.lang.Object[] arguments)Invokes a method.- Parameters:
method- the method to invokeself- the object contextarguments- the call arguments- Returns:
- the method result
-
finalizeModel
void finalizeModel(IModel model)
Finalizes the given model.- Parameters:
model- the given model
-
getID
java.lang.Object getID(java.lang.Object element)
Returns the element id.- Parameters:
element- the element- Returns:
- the element id
-
isDeleted
boolean isDeleted(java.lang.Object element)
Checks if an elements has been deleted in refining mode and does not belong to any resource.- Parameters:
element- the element- Returns:
- ture if the element has been deleted. False otherwise.
-
setID
void setID(java.lang.Object element, java.lang.Object id)Sets the element id.- Parameters:
element- the elementid- the id to set
-
isModelElement
boolean isModelElement(java.lang.Object o)
Returnstrueif the given object is managed by the current model adapter.- Parameters:
o- the given object- Returns:
trueif the given object is managed by the current model adapter
-
isMetametaElement
boolean isMetametaElement(java.lang.Object element)
Returnstrueif the given element is managed by the metametamodel of the current model adapter.- Parameters:
element- the given element- Returns:
trueif the given element is managed by the metametamodel of the current model adapter
-
-