Class AutomatonMacroAPI


  • @OpenApiAll
    public class AutomatonMacroAPI
    extends java.lang.Object
    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.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.Object addStereotype​(com.nomagic.magicdraw.automaton.AutomatonOpaqueObject marcoElement, com.nomagic.magicdraw.automaton.AutomatonOpaqueObject marcoStereotype)
      Adds the stereotype.
      static java.lang.Object addStereotypeByStereotypeName​(com.nomagic.magicdraw.automaton.AutomatonOpaqueObject marcoElement, java.lang.String stereotypeName)
      Adds the stereotype by stereotype name.
      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.
      protected static java.lang.Object convertSettingValue​(java.lang.Object value)
      Convert opaque to element value.
      static java.lang.Object createElement​(java.lang.String metaName)
      Creates the new dsl element.
      static java.lang.Object createRelationship​(com.nomagic.magicdraw.automaton.AutomatonOpaqueObject source, com.nomagic.magicdraw.automaton.AutomatonOpaqueObject target, java.lang.String relationName)
      Creates the relationship.
      static java.lang.Object getModelData()
      Gets the model data.
      static com.nomagic.magicdraw.automaton.AutomatonOpaqueObject getOpaqueMetaClass​(java.lang.String name)  
      static java.lang.Object getOpaqueObject​(java.lang.Object element)
      Gets the opaque object.
      static java.lang.Object getOpaqueObjectByPath​(java.lang.String elementPath)
      New dsl instance.
      static java.lang.Object getPropertyValue​(com.nomagic.magicdraw.automaton.AutomatonOpaqueObject macroObj, java.lang.String name, java.lang.String qualifierPath)
      Gets the property value.
      static java.lang.Object getPropertyValue​(com.nomagic.magicdraw.automaton.AutomatonOpaqueObject macroObj, java.lang.String name, java.lang.String qualifierPath, boolean withException)  
      static java.lang.Object getSelectedElementFromContainmentTree()
      Gets the selection model.
      static void printElementDetail​(java.lang.Object eObj)
      Prints the element detail.
      static void removeElement​(java.lang.Object obj)
      Removes the element.
      static java.lang.Object removeStereotype​(com.nomagic.magicdraw.automaton.AutomatonOpaqueObject marcoElement, com.nomagic.magicdraw.automaton.AutomatonOpaqueObject marcoStereotype)
      Removes the stereotype.
      static java.lang.Object removeStereotypeByStereotypeName​(com.nomagic.magicdraw.automaton.AutomatonOpaqueObject marcoElement, java.lang.String stereotypeName)
      Removes the stereotype by stereotype name.
      static void setPropertyValue​(com.nomagic.magicdraw.automaton.AutomatonOpaqueObject macroObject, java.lang.String name, java.lang.String qualifierPath, java.lang.Object value)
      Sets the property value.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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
    • Constructor Detail

      • AutomatonMacroAPI

        public AutomatonMacroAPI()
    • Method Detail

      • createElement

        public static java.lang.Object createElement​(java.lang.String metaName)
                                              throws java.lang.Exception
        Creates 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.Exception
        Creates the relationship. (User script API)
        Parameters:
        source - the source
        target - the target
        relationName - 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.Exception
        New 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 macroObj
        name - the name
        qualifierPath - 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.Exception
        Sets the property value. (User script API) WARNNING: Do not change this method signature. It will impact ByteCode generation
        Parameters:
        macroObject - the macroObject
        name - the name
        qualifierPath - the qualifierPath
        value - 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.Exception
        Removes the element. (User script API)
        Parameters:
        obj - the obj
        Throws:
        javax.activation.UnsupportedDataTypeException - the unsupported data type exception
        java.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.Exception
        Adds the stereotype. (User script API)
        Parameters:
        marcoElement - the element
        marcoStereotype - 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.Exception
        Adds the stereotype by stereotype name. (User script API)
        Parameters:
        marcoElement - the marco element
        stereotypeName - 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.Exception
        Removes the stereotype. (User script API)
        Parameters:
        marcoElement - the o element
        marcoStereotype - 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.Exception
        Removes the stereotype by stereotype name. (User script API)
        Parameters:
        marcoElement - the marco element
        stereotypeName - 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.Exception
        Gets 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.Exception
        Gets 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.UnsupportedDataTypeException
        Prints 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