Package com.nomagic.magicdraw.automaton
Class AutomatonMacroAPI
java.lang.Object
com.nomagic.magicdraw.automaton.AutomatonMacroAPI
The Class AutomatonMacroAPI. API to be called by script. WARNNING: Class signature shouldn't be changed. Some method
signature souldn't be changed. It will impact ByteCode generation.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ObjectaddStereotype(com.nomagic.magicdraw.automaton.AutomatonOpaqueObject marcoElement, com.nomagic.magicdraw.automaton.AutomatonOpaqueObject marcoStereotype) Adds the stereotype.static ObjectaddStereotypeByStereotypeName(com.nomagic.magicdraw.automaton.AutomatonOpaqueObject marcoElement, String stereotypeName) Adds the stereotype by stereotype name.protected static ObjectconvertGettingValue(Object result, com.nomagic.magicdraw.automaton.AutomatonOpaqueObject macroObj, String name, String qualifierPath, boolean needCommitted) Convert element to opaque.protected static ObjectconvertSettingValue(Object value) Convert opaque to element value.static ObjectcreateElement(String metaName) Creates the new dsl element.static ObjectcreateRelationship(com.nomagic.magicdraw.automaton.AutomatonOpaqueObject source, com.nomagic.magicdraw.automaton.AutomatonOpaqueObject target, String relationName) Creates the relationship.static ObjectGets the model data.static com.nomagic.magicdraw.automaton.AutomatonOpaqueObjectgetOpaqueMetaClass(String name) static ObjectgetOpaqueObject(Object element) Gets the opaque object.static ObjectgetOpaqueObjectByPath(String elementPath) New dsl instance.static ObjectgetPropertyValue(com.nomagic.magicdraw.automaton.AutomatonOpaqueObject macroObj, String name, String qualifierPath) Gets the property value.static ObjectgetPropertyValue(com.nomagic.magicdraw.automaton.AutomatonOpaqueObject macroObj, String name, String qualifierPath, boolean withException) static ObjectGets the selection model.static voidprintElementDetail(Object eObj) Prints the element detail.static voidremoveElement(Object obj) Removes the element.static ObjectremoveStereotype(com.nomagic.magicdraw.automaton.AutomatonOpaqueObject marcoElement, com.nomagic.magicdraw.automaton.AutomatonOpaqueObject marcoStereotype) Removes the stereotype.static ObjectremoveStereotypeByStereotypeName(com.nomagic.magicdraw.automaton.AutomatonOpaqueObject marcoElement, String stereotypeName) Removes the stereotype by stereotype name.static voidsetPropertyValue(com.nomagic.magicdraw.automaton.AutomatonOpaqueObject macroObject, String name, String qualifierPath, Object value) Sets the property value.
-
Field Details
-
METHOD_NAME_GET_PROP_VALUE
The Constant METHOD_NAME_GET_PROP_VALUE.- See Also:
-
METHOD_NAME_SET_PROP_VALUE
The Constant METHOD_NAME_SET_PROP_VALUE.- See Also:
-
-
Constructor Details
-
AutomatonMacroAPI
public AutomatonMacroAPI()
-
-
Method Details
-
createElement
Creates the new dsl element. (User script API)- Parameters:
metaName- the dsl meta name- Returns:
- the object
- Throws:
Exception- the exception throws when cannot create Element with meta-class names metaName
-
createRelationship
public static Object createRelationship(com.nomagic.magicdraw.automaton.AutomatonOpaqueObject source, com.nomagic.magicdraw.automaton.AutomatonOpaqueObject target, String relationName) throws Exception Creates the relationship. (User script API)- Parameters:
source- the sourcetarget- the targetrelationName- the relation name- Returns:
- opaque object of relation element
- Throws:
Exception- the exception throws when not found a relation for relationName
-
getOpaqueObjectByPath
New dsl instance. (User script API)- Parameters:
elementPath- the element path- Returns:
- the object
- Throws:
Exception- the exception throws when not found an element for path elementPath
-
getOpaqueObject
Gets the opaque object.- Parameters:
element- the element- Returns:
- the opaque object
-
getPropertyValue
public static Object getPropertyValue(com.nomagic.magicdraw.automaton.AutomatonOpaqueObject macroObj, String name, String qualifierPath) Gets the property value. (User script API) WARNNING: Do not change this method signature. It will impact ByteCode generation- Parameters:
macroObj- the macroObjname- the namequalifierPath- the qualifierPath- Returns:
- the property value
-
getPropertyValue
-
setPropertyValue
public static void setPropertyValue(com.nomagic.magicdraw.automaton.AutomatonOpaqueObject macroObject, String name, String qualifierPath, Object value) throws Exception Sets the property value. (User script API) WARNNING: Do not change this method signature. It will impact ByteCode generation- Parameters:
macroObject- the macroObjectname- the namequalifierPath- the qualifierPathvalue- the value- Throws:
Exception- the exception throws when cannot set the property value
-
getOpaqueMetaClass
-
removeElement
public static void removeElement(Object obj) throws jakarta.activation.UnsupportedDataTypeException, Exception Removes the element. (User script API)- Parameters:
obj- the obj- Throws:
jakarta.activation.UnsupportedDataTypeException- the unsupported data type exceptionException- the exception throws when not found the element
-
addStereotype
public static Object addStereotype(com.nomagic.magicdraw.automaton.AutomatonOpaqueObject marcoElement, com.nomagic.magicdraw.automaton.AutomatonOpaqueObject marcoStereotype) throws Exception Adds the stereotype. (User script API)- Parameters:
marcoElement- the elementmarcoStereotype- the stereotype- Returns:
- a new opaque object which contains getters and setters with regards to the applied stereotype's properties.
- Throws:
Exception- the exception throws when marcoStereotype is not a stereotype
-
addStereotypeByStereotypeName
public static Object addStereotypeByStereotypeName(com.nomagic.magicdraw.automaton.AutomatonOpaqueObject marcoElement, String stereotypeName) throws Exception Adds the stereotype by stereotype name. (User script API)- Parameters:
marcoElement- the marco elementstereotypeName- the stereotype name- Returns:
- the object
- Throws:
Exception- the exception throws when not found a stereotype for stereotypeName
-
removeStereotype
public static Object removeStereotype(com.nomagic.magicdraw.automaton.AutomatonOpaqueObject marcoElement, com.nomagic.magicdraw.automaton.AutomatonOpaqueObject marcoStereotype) throws Exception Removes the stereotype. (User script API)- Parameters:
marcoElement- the o elementmarcoStereotype- the o stereotype- Returns:
- the object
- Throws:
Exception- the exception throws when marcoStereotype is not a stereotype or element doesn't contain the stereotype
-
removeStereotypeByStereotypeName
public static Object removeStereotypeByStereotypeName(com.nomagic.magicdraw.automaton.AutomatonOpaqueObject marcoElement, String stereotypeName) throws Exception Removes the stereotype by stereotype name. (User script API)- Parameters:
marcoElement- the marco elementstereotypeName- the stereotype name- Returns:
- the object
- Throws:
Exception- the exception throws when marcoStereotype is not a stereotype or element doesn't contain the stereotypeName
-
getSelectedElementFromContainmentTree
Gets the selection model. (User script API)- Returns:
- the selection model
- Throws:
Exception- the exception
-
getModelData
Gets the model data. (User script API)- Returns:
- the model data
- Throws:
Exception- the exception
-
printElementDetail
public static void printElementDetail(Object eObj) throws jakarta.activation.UnsupportedDataTypeException Prints the element detail. (User script API)- Parameters:
eObj- the element- Throws:
jakarta.activation.UnsupportedDataTypeException- the unsupported data type exception
-
convertSettingValue
Convert opaque to element value.- Parameters:
value- the value- Returns:
- the object
-
convertGettingValue
protected static Object convertGettingValue(Object result, com.nomagic.magicdraw.automaton.AutomatonOpaqueObject macroObj, String name, String qualifierPath, boolean needCommitted) Convert element to opaque.- Parameters:
result- the result- Returns:
- the object
-