Class ExecEnv
java.lang.Object
org.eclipse.m2m.atl.engine.emfvm.lib.ExecEnv
Execution environment.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
enterTools
(AbstractStackFrame frame) Enters the tools.static Object
findMetaElement
(AbstractStackFrame frame, Object mname, Object me) Finds a meta element by its name.getAttributeInitializer
(Object type, String name) Returns the attribute initializer.getHelperValue
(AbstractStackFrame frame, Object type, Object element, String name) Gets the value of an helper.Returns the model by name.getModelNameOf
(Object element) Returns the model containing the element.getModelOf
(Object element) Get the model of a given element.Returns the model name.long
getOperation
(Object type, Object name) Find an operation by its context type and name.void
Increments the nbExecutedBytecodes.void
init
(IModelAdapter modelAdapterParam) Initializes the execenv.boolean
Returns true if the given type has a helper with the given name.boolean
isStep()
boolean
isWeavingHelper
(Object type, String name) Returns true if there is a weaving helper for the given type and name.void
leaveTools
(AbstractStackFrame frame) Leaves the tools.newElement
(AbstractStackFrame frame, Object ec) Creates a new element in the given frame.newElement
(AbstractStackFrame frame, Object ec, String metamodelName) Creates a new element in the given frame.newElementIn
(AbstractStackFrame frame, Object ec, String modelName) Creates a new element in the given frame and the given model.void
prettyPrint
(PrintStream out, Object value) Displays a value.void
prettyPrint
(Object value) Displays a value.void
prettyPrintCollection
(PrintStream out, Collection<?> col) Display a collection.void
registerHelperAttribute
(Object type, String name, String initOperationName) Stores an attribute helper.void
registerOperation
(Object type, Operation oper) Registers operation for a given type.void
registerOperation
(Object type, Operation oper, String name) Deprecated.void
registerWeavingHelper
(Object type, String name, String persistTo) Registers a weaving helper.void
setHelperValue
(Object element, String name, Object value) Sets an helper value (only for weaving helpers).void
setStep
(boolean step) void
stepTools
(AbstractStackFrame frame) Steps the tools.void
Ends the execution.void
Terminates the tools.toPrettyPrintedString
(Object value) Converts a value to a displayable string.
-
Constructor Details
-
ExecEnv
Creates a new execenv parametrized by models.- Parameters:
models
- the models maptools
- the execution tools
-
-
Method Details
-
stepTools
Steps the tools.- Parameters:
frame
- the frame
-
enterTools
Enters the tools.- Parameters:
frame
- the frame
-
leaveTools
Leaves the tools.- Parameters:
frame
- the frame
-
terminateTools
public void terminateTools()Terminates the tools. -
init
Initializes the execenv.- Parameters:
modelAdapterParam
- the model adapter
-
getModelNameOf
Returns the model containing the element.- Parameters:
element
- a model element- Returns:
- the model containing the element
-
getNameOf
Returns the model name.- Parameters:
model
- a model- Returns:
- the model name
-
getModel
Returns the model by name.- Parameters:
name
- the model name- Returns:
- the model by name
-
getModels
-
getOperation
Find an operation by its context type and name.- Parameters:
type
- operation context typename
- operation name- Returns:
- the operation
-
registerHelperAttribute
Stores an attribute helper.- Parameters:
type
- the attribute typename
- the attribute nameinitOperationName
- the init operation name
-
getAttributeInitializer
Returns the attribute initializer.- Parameters:
type
- the attribute typename
- the attribute name- Returns:
- the attribute initializer
-
getHelperValue
Gets the value of an helper.- Parameters:
frame
- the frame contexttype
- the helper typeelement
- the elementname
- the helper value name- Returns:
- the value
-
registerOperation
Deprecated.useregisterOperation(Object, Operation)
insteadRegisters operation for a given type.- Parameters:
type
- the typeoper
- the operationname
- the operation name
-
registerOperation
Registers operation for a given type.- Parameters:
type
- the typeoper
- the operation
-
toPrettyPrintedString
Converts a value to a displayable string.- Parameters:
value
- the value to convert- Returns:
- the displayable string
-
prettyPrint
Displays a value.- Parameters:
value
- the value to display
-
prettyPrint
Displays a value.- Parameters:
out
- the streamvalue
- the value to display
-
prettyPrintCollection
Display a collection.- Parameters:
out
- the out streamcol
- the collection
-
findMetaElement
Finds a meta element by its name.- Parameters:
frame
- the frame contextmname
- the metamodel nameme
- the model element- Returns:
- the meta element
-
newElement
Creates a new element in the given frame.- Parameters:
frame
- the frame contextec
- the element type- Returns:
- the new element
-
newElement
Creates a new element in the given frame.- Parameters:
frame
- the frame contextec
- the element typemetamodelName
- the metamodel name- Returns:
- the new element
-
newElementIn
Creates a new element in the given frame and the given model.- Parameters:
frame
- the frame contextec
- the element typemodelName
- the model name- Returns:
- the new element
-
getModelsByName
-
isStep
public boolean isStep() -
setStep
public void setStep(boolean step) -
getModelAdapter
-
getNbExecutedBytecodes
public long getNbExecutedBytecodes() -
incNbExecutedBytecodes
public void incNbExecutedBytecodes()Increments the nbExecutedBytecodes. -
isWeavingHelper
Returns true if there is a weaving helper for the given type and name.- Parameters:
type
- the helper typename
- the helper name- Returns:
- true if there is a weaving helper for the given type and name
-
registerWeavingHelper
Registers a weaving helper.- Parameters:
type
- the helper contextname
- the helper namepersistTo
- the name of the feature to persist
-
isHelper
Returns true if the given type has a helper with the given name.- Parameters:
type
- the given typename
- the helper name- Returns:
- true if the given type has a helper with the given name
-
setHelperValue
Sets an helper value (only for weaving helpers).- Parameters:
element
- the helper contextname
- the helper namevalue
- the value to set
-
terminated
public void terminated()Ends the execution. -
getModelOf
Get the model of a given element.- Parameters:
element
- the given element- Returns:
- the model
-
registerOperation(Object, Operation)
instead