Exemplo n.º 1
0
 def _getParam(self, Param):
     aParam = PyutParam()
     if Param.hasAttribute('defaultValue'):
         aParam.setDefaultValue(Param.getAttribute('defaultValue'))
     aParam.setName(Param.getAttribute('name'))
     aParam.setType(Param.getAttribute('type'))
     return aParam
Exemplo n.º 2
0
    def _getParam(self, Param: Element, pyutMethod: PyutMethod):
        """
        Extract param from Xmi file from Class part.

        Args:
            Param:
            pyutMethod:

        Returns: PyutParam
        """
        aParam = PyutParam()

        # param's name
        name = Param.getElementsByTagName(
            "Foundation.Core.ModelElement.name")[0].firstChild
        if name.nodeType == name.TEXT_NODE:
            self.logger.debug(f'Parameter name: {name.data}')
            if name.data[-6:] == "Return" or name.data[-6:] == "return":
                self._getTypeId(Param, pyutMethod, self.dicoReturn)
                return None
            else:
                aParam.setName(name.data)

        # default value
        self._getDefaultValue(Param, aParam)

        # for type
        self._getTypeId(Param, aParam, self.dicoType)

        return aParam
Exemplo n.º 3
0
    def _getParam(self, Param, pyutMethod):
        """
        Extract param from Xmi file from Class part.

        @param   minidom.Element  : Param
        @param   pyutMethod for returned type
        @return  PyutParam

        @since 1.0
        @author Deve Roux <*****@*****.**>
        """
        aParam = PyutParam()

        # param's name
        name = Param.getElementsByTagName("Foundation.Core.ModelElement.name")[0].firstChild
        if name.nodeType == name.TEXT_NODE:
            self.logger.debug(f'Parameter name: {name.data}')
            if name.data[-6:] == "Return" or name.data[-6:] == "return":
                self._getTypeId(Param, pyutMethod, self.dicoReturn)
                return None
            else:
                aParam.setName(name.data)

        # default value
        self._getDefaultValue(Param, aParam)

        # for type
        self._getTypeId(Param, aParam, self.dicoType)

        return aParam