def __loadMethods(self, method): methodName = method.attrib["name"] returns = method.attrib["returnType"] myFactory = dataFactoryGiws() myReturnData = myFactory.create(returns) detachThread = False if "detachThread" in method.attrib: str = method.attrib["detachThread"].lower() if str == "true": detachThread = True if "modifier" in method.attrib: modifier = method.attrib["modifier"] Jmethod = methodGiws(methodName, myReturnData, detachThread, modifier) else: Jmethod = methodGiws(methodName, myReturnData, detachThread) parametersName = [] # To check if the parameter is not already defined for param in method: # We browse the parameters of the method param = self.__loadParameter(param.attrib) try: if parametersName.index(param.getName()) >= 0: print('%s is already defined as parameters' % param.getName()) sys.exit(-3) except ValueError: #Cannot find the parameter => not defined. Good! parametersName.append(param.getName()) Jmethod.addParameter(param) return Jmethod
def __loadMethods(self, method): methodName=method.attrib["name"] returns=method.attrib["returnType"] myFactory=dataFactoryGiws() myReturnData=myFactory.create(returns) detachThread=False if "detachThread" in method.attrib: str=method.attrib["detachThread"].lower() if str=="true": detachThread=True if "modifier" in method.attrib: modifier=method.attrib["modifier"] Jmethod=methodGiws(methodName,myReturnData,detachThread,modifier) else: Jmethod=methodGiws(methodName,myReturnData,detachThread) parametersName=[] # To check if the parameter is not already defined for param in method: # We browse the parameters of the method param=self.__loadParameter(param.attrib) try: if parametersName.index(param.getName()) >= 0: print ('%s is already defined as parameters'%param.getName()) sys.exit(-3) except ValueError: #Cannot find the parameter => not defined. Good! parametersName.append(param.getName()) Jmethod.addParameter(param) return Jmethod
def __loadMethods(self, method): returns=method.prop("returnType") myFactory=dataFactoryGiws() myReturnData=myFactory.create(returns) modifier=method.prop("modifier") detachThreadProp=method.prop("detachThread") detachThread=False if detachThreadProp!=None: str=detachThreadProp.lower() if str=="true": detachThread=True if modifier!=None: Jmethod=methodGiws(method.properties.getContent(),myReturnData,detachThread,modifier) else: Jmethod=methodGiws(method.properties.getContent(),myReturnData,detachThread) child = method.children parametersName=[] # To check if the parameter is not already defined while child is not None: # We browse the parameters of the method if child.type == "element": prop=child.properties param=self.__loadParameter(prop) try: if parametersName.index(param.getName()) >= 0: print ('%s is already defined as parameters'%param.getName()) sys.exit(-3) except ValueError: #Cannot find the parameter => not defined. Good! parametersName.append(param.getName()) Jmethod.addParameter(param) child = child.next return Jmethod
def __loadMethods(self, method): returns = method.prop("returnType") myFactory = dataFactoryGiws() myReturnData = myFactory.create(returns) modifier = method.prop("modifier") detachThreadProp = method.prop("detachThread") detachThread = False if detachThreadProp != None: str = detachThreadProp.lower() if str == "true": detachThread = True if modifier != None: Jmethod = methodGiws(method.properties.getContent(), myReturnData, detachThread, modifier) else: Jmethod = methodGiws(method.properties.getContent(), myReturnData, detachThread) child = method.children parametersName = [] # To check if the parameter is not already defined while child is not None: # We browse the parameters of the method if child.type == "element": prop = child.properties param = self.__loadParameter(prop) try: if parametersName.index(param.getName()) >= 0: print('%s is already defined as parameters' % param.getName()) sys.exit(-3) except ValueError: #Cannot find the parameter => not defined. Good! parametersName.append(param.getName()) Jmethod.addParameter(param) child = child.next return Jmethod
def __init__(self, name, type): myDataFactory = dataFactoryGiws() self.__type = myDataFactory.create(type) self.__name = name
def __init__(self, type): myDataFactory=dataFactoryGiws() self.__type=myDataFactory.create(type)