Package com.nomagic.magicdraw.automaton
Class AutomatonMacroAPI
- java.lang.Object
-
- com.nomagic.magicdraw.automaton.AutomatonMacroAPI
-
@OpenApiAll public class AutomatonMacroAPI extends java.lang.ObjectThe 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 Modifier and Type Field Description static java.lang.StringMETHOD_NAME_GET_PROP_VALUEThe Constant METHOD_NAME_GET_PROP_VALUE.static java.lang.StringMETHOD_NAME_SET_PROP_VALUEThe Constant METHOD_NAME_SET_PROP_VALUE.
-
Constructor Summary
Constructors Constructor Description AutomatonMacroAPI()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.ObjectaddStereotype(com.nomagic.magicdraw.automaton.AutomatonOpaqueObject marcoElement, com.nomagic.magicdraw.automaton.AutomatonOpaqueObject marcoStereotype)Adds the stereotype.static java.lang.ObjectaddStereotypeByStereotypeName(com.nomagic.magicdraw.automaton.AutomatonOpaqueObject marcoElement, java.lang.String stereotypeName)Adds the stereotype by stereotype name.protected static java.lang.ObjectconvertGettingValue(java.lang.Object result, com.nomagic.magicdraw.automaton.AutomatonOpaqueObject macroObj, java.lang.String name, java.lang.String qualifierPath, boolean needCommitted)Convert element to opaque.protected static java.lang.ObjectconvertSettingValue(java.lang.Object value)Convert opaque to element value.static java.lang.ObjectcreateElement(java.lang.String metaName)Creates the new dsl element.static java.lang.ObjectcreateRelationship(com.nomagic.magicdraw.automaton.AutomatonOpaqueObject source, com.nomagic.magicdraw.automaton.AutomatonOpaqueObject target, java.lang.String relationName)Creates the relationship.static java.lang.ObjectgetModelData()Gets the model data.static com.nomagic.magicdraw.automaton.AutomatonOpaqueObjectgetOpaqueMetaClass(java.lang.String name)static java.lang.ObjectgetOpaqueObject(java.lang.Object element)Gets the opaque object.static java.lang.ObjectgetOpaqueObjectByPath(java.lang.String elementPath)New dsl instance.static java.lang.ObjectgetPropertyValue(com.nomagic.magicdraw.automaton.AutomatonOpaqueObject macroObj, java.lang.String name, java.lang.String qualifierPath)Gets the property value.static java.lang.ObjectgetPropertyValue(com.nomagic.magicdraw.automaton.AutomatonOpaqueObject macroObj, java.lang.String name, java.lang.String qualifierPath, boolean withException)static java.lang.ObjectgetSelectedElementFromContainmentTree()Gets the selection model.static voidprintElementDetail(java.lang.Object eObj)Prints the element detail.static voidremoveElement(java.lang.Object obj)Removes the element.static java.lang.ObjectremoveStereotype(com.nomagic.magicdraw.automaton.AutomatonOpaqueObject marcoElement, com.nomagic.magicdraw.automaton.AutomatonOpaqueObject marcoStereotype)Removes the stereotype.static java.lang.ObjectremoveStereotypeByStereotypeName(com.nomagic.magicdraw.automaton.AutomatonOpaqueObject marcoElement, java.lang.String stereotypeName)Removes the stereotype by stereotype name.static voidsetPropertyValue(com.nomagic.magicdraw.automaton.AutomatonOpaqueObject macroObject, java.lang.String name, java.lang.String qualifierPath, java.lang.Object value)Sets the property value.
-
-
-
Field Detail
-
METHOD_NAME_GET_PROP_VALUE
public static final java.lang.String METHOD_NAME_GET_PROP_VALUE
The Constant METHOD_NAME_GET_PROP_VALUE.- See Also:
- Constant Field Values
-
METHOD_NAME_SET_PROP_VALUE
public static final java.lang.String METHOD_NAME_SET_PROP_VALUE
The Constant METHOD_NAME_SET_PROP_VALUE.- See Also:
- Constant Field Values
-
-
Method Detail
-
createElement
public static java.lang.Object createElement(java.lang.String metaName) throws java.lang.ExceptionCreates the new dsl element. (User script API)- Parameters:
metaName- the dsl meta name- Returns:
- the object
- Throws:
java.lang.Exception- the exception throws when cannot create Element with meta-class names metaName
-
createRelationship
public static java.lang.Object createRelationship(com.nomagic.magicdraw.automaton.AutomatonOpaqueObject source, com.nomagic.magicdraw.automaton.AutomatonOpaqueObject target, java.lang.String relationName) throws java.lang.ExceptionCreates the relationship. (User script API)- Parameters:
source- the sourcetarget- the targetrelationName- the relation name- Returns:
- opaque object of relation element
- Throws:
java.lang.Exception- the exception throws when not found a relation for relationName
-
getOpaqueObjectByPath
public static java.lang.Object getOpaqueObjectByPath(java.lang.String elementPath) throws java.lang.ExceptionNew dsl instance. (User script API)- Parameters:
elementPath- the element path- Returns:
- the object
- Throws:
java.lang.Exception- the exception throws when not found an element for path elementPath
-
getOpaqueObject
public static java.lang.Object getOpaqueObject(java.lang.Object element)
Gets the opaque object.- Parameters:
element- the element- Returns:
- the opaque object
-
getPropertyValue
public static java.lang.Object getPropertyValue(com.nomagic.magicdraw.automaton.AutomatonOpaqueObject macroObj, java.lang.String name, java.lang.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
public static java.lang.Object getPropertyValue(com.nomagic.magicdraw.automaton.AutomatonOpaqueObject macroObj, java.lang.String name, java.lang.String qualifierPath, boolean withException)
-
setPropertyValue
public static void setPropertyValue(com.nomagic.magicdraw.automaton.AutomatonOpaqueObject macroObject, java.lang.String name, java.lang.String qualifierPath, java.lang.Object value) throws java.lang.ExceptionSets 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:
java.lang.Exception- the exception throws when cannot set the property value
-
getOpaqueMetaClass
public static com.nomagic.magicdraw.automaton.AutomatonOpaqueObject getOpaqueMetaClass(java.lang.String name)
-
removeElement
public static void removeElement(java.lang.Object obj) throws javax.activation.UnsupportedDataTypeException, java.lang.ExceptionRemoves the element. (User script API)- Parameters:
obj- the obj- Throws:
javax.activation.UnsupportedDataTypeException- the unsupported data type exceptionjava.lang.Exception- the exception throws when not found the element
-
addStereotype
public static java.lang.Object addStereotype(com.nomagic.magicdraw.automaton.AutomatonOpaqueObject marcoElement, com.nomagic.magicdraw.automaton.AutomatonOpaqueObject marcoStereotype) throws java.lang.ExceptionAdds 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:
java.lang.Exception- the exception throws when marcoStereotype is not a stereotype
-
addStereotypeByStereotypeName
public static java.lang.Object addStereotypeByStereotypeName(com.nomagic.magicdraw.automaton.AutomatonOpaqueObject marcoElement, java.lang.String stereotypeName) throws java.lang.ExceptionAdds the stereotype by stereotype name. (User script API)- Parameters:
marcoElement- the marco elementstereotypeName- the stereotype name- Returns:
- the object
- Throws:
java.lang.Exception- the exception throws when not found a stereotype for stereotypeName
-
removeStereotype
public static java.lang.Object removeStereotype(com.nomagic.magicdraw.automaton.AutomatonOpaqueObject marcoElement, com.nomagic.magicdraw.automaton.AutomatonOpaqueObject marcoStereotype) throws java.lang.ExceptionRemoves the stereotype. (User script API)- Parameters:
marcoElement- the o elementmarcoStereotype- the o stereotype- Returns:
- the object
- Throws:
java.lang.Exception- the exception throws when marcoStereotype is not a stereotype or element doesn't contain the stereotype
-
removeStereotypeByStereotypeName
public static java.lang.Object removeStereotypeByStereotypeName(com.nomagic.magicdraw.automaton.AutomatonOpaqueObject marcoElement, java.lang.String stereotypeName) throws java.lang.ExceptionRemoves the stereotype by stereotype name. (User script API)- Parameters:
marcoElement- the marco elementstereotypeName- the stereotype name- Returns:
- the object
- Throws:
java.lang.Exception- the exception throws when marcoStereotype is not a stereotype or element doesn't contain the stereotypeName
-
getSelectedElementFromContainmentTree
public static java.lang.Object getSelectedElementFromContainmentTree() throws java.lang.ExceptionGets the selection model. (User script API)- Returns:
- the selection model
- Throws:
java.lang.Exception- the exception
-
getModelData
public static java.lang.Object getModelData() throws java.lang.ExceptionGets the model data. (User script API)- Returns:
- the model data
- Throws:
java.lang.Exception- the exception
-
printElementDetail
public static void printElementDetail(java.lang.Object eObj) throws javax.activation.UnsupportedDataTypeExceptionPrints the element detail. (User script API)- Parameters:
eObj- the element- Throws:
javax.activation.UnsupportedDataTypeException- the unsupported data type exception
-
convertSettingValue
protected static java.lang.Object convertSettingValue(java.lang.Object value)
Convert opaque to element value.- Parameters:
value- the value- Returns:
- the object
-
convertGettingValue
protected static java.lang.Object convertGettingValue(java.lang.Object result, com.nomagic.magicdraw.automaton.AutomatonOpaqueObject macroObj, java.lang.String name, java.lang.String qualifierPath, boolean needCommitted)Convert element to opaque.- Parameters:
result- the result- Returns:
- the object
-
-