def Build(self, xsdTypeDict, cTypeDict): self._xsd_type = xsdTypeDict[self._name] children = self._xsd_type.getChildren() if children: for child in children: if child.isComplex(): descendent = ComplexTypeLocate(xsdTypeDict, cTypeDict, child.getType()) self._data_types.append(descendent) cpptype = child.getType() jtype = child.getType() cppname = child.getCleanName() else: cpptype = getCppType(child.getType()) jtype = getJavaType(child.getType()) if cpptype == 'void': logger = logging.getLogger('type_model') logger.warning('simpleType %s: unknown' % child.getType()) cppname = child.getCleanName() member = MemberInfo() member.elementname = child.getName() member.membername = CppVariableName(cppname) member.xsd_object = child member.isComplex = child.isComplex() if child.getMaxOccurs() > 1: member.membername = cppname # + '_list' member.sequenceType = cpptype cpptype = 'std::vector<%s>' % cpptype jtype = 'List<%s>' % jtype member.isSequence = True member.ctypename = cpptype member.jtypename = jtype member.default = child.getDefault() self._data_members.append(member) else: attributes = list(self._xsd_type.getAttributeDefs().values()) if attributes: self._is_attribute = True for attribute in attributes: cpptype = getCppType(attribute.getType()) jtype = getJavaType(attribute.getType()) if cpptype == 'void': logger = logging.getLogger('type_model') logger.warning('simpleType %s: unknown' % attribute.getType()) cppname = attribute.getCleanName() member = MemberInfo() member.elementname = attribute.getName() member.membername = CppVariableName(cppname) member.xsd_object = attribute member.isComplex = False member.ctypename = cpptype member.jtypename = jtype member.default = attribute.getDefault() self._data_members.append(member)
def Build(self, xsdTypeDict, cTypeDict): self._xsd_type = xsdTypeDict[self._name] children = self._xsd_type.getChildren() if children: for child in children: if child.isComplex(): descendent = ComplexTypeLocate(xsdTypeDict, cTypeDict, child.getType()) self._data_types.append(descendent) cpptype = child.getType() jtype = child.getType() cppname = child.getCleanName() else: cpptype = getCppType(child.getType()) jtype = getJavaType(child.getType()) if cpptype == "void": logger = logging.getLogger("type_model") logger.warning("simpleType %s: unknown" % child.getType()) cppname = child.getCleanName() member = MemberInfo() member.elementname = child.getName() member.membername = CppVariableName(cppname) member.xsd_object = child member.isComplex = child.isComplex() if child.getMaxOccurs() > 1: member.membername = cppname # + '_list' member.sequenceType = cpptype cpptype = "std::vector<%s>" % cpptype jtype = "List<%s>" % jtype member.isSequence = True member.ctypename = cpptype member.jtypename = jtype member.default = child.getDefault() self._data_members.append(member) else: attributes = self._xsd_type.getAttributeDefs().values() if attributes: self._is_attribute = True for attribute in attributes: cpptype = getCppType(attribute.getType()) jtype = getJavaType(attribute.getType()) if cpptype == "void": logger = logging.getLogger("type_model") logger.warning("simpleType %s: unknown" % attribute.getType()) cppname = attribute.getCleanName() member = MemberInfo() member.elementname = attribute.getName() member.membername = CppVariableName(cppname) member.xsd_object = attribute member.isComplex = False member.ctypename = cpptype member.jtypename = jtype member.default = attribute.getDefault() self._data_members.append(member)
def Build(self, xsdTypeDict, cTypeDict): self._xsd_type = xsdTypeDict[self._name] children = self._xsd_type.getChildren() for child in children: if child.isComplex(): descendent = ComplexTypeLocate(xsdTypeDict, cTypeDict, child.getType()) self._data_types.append(descendent) cpptype = child.getType() jtype = child.getType() cppname = child.getCleanName() else: cpptype = getCppType(child.getType()) jtype = getJavaType(child.getType()) if cpptype == 'void': logger = logging.getLogger('type_model') logger.warning('simpleType %s: unknown' % child.getType()) cppname = child.getCleanName() member = MemberInfo() member.elementname = child.getName() member.membername = CppVariableName(cppname) member.xsd_object = child member.isComplex = child.isComplex() if child.getMaxOccurs() > 1: member.membername = cppname# + '_list' member.sequenceType = cpptype cpptype = 'std::vector<%s>' % cpptype jtype = 'List<%s>' % jtype member.isSequence = True member.ctypename = cpptype member.jtypename = jtype self._data_members.append(member)
def _BuildSimpleProperty(self, prop): member = MemberInfo() member.membername = prop.getPropertyName() + '_' member.xsd_object = prop._xelement member.isComplex = False member.ctypename = getCppType(prop._xelement.getType()) prop._memberinfo = member self._data_members.append(member)
def getCTypename(self): if self._xelement.isComplex(): return self._complexType.getName() return getCppType(self._xelement.getType())