Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def getTypeByString(self, stringName, encodingRule):
stringName = str(stringName.lower())
if stringName == 'boolean':
t = Boolean()
elif stringName == 'number':
t = Number()
elif stringName == 'integer':
t = Integer()
elif stringName == 'uinteger':
t = UInteger()
elif stringName == 'int32':
t = Int32()
elif stringName == 'uint32':
t = UInt32()
elif stringName == 'int16':
t = Int16()
elif stringName == 'uint16':
t = UInt16()
elif stringName == 'int64':
t = Int64()
elif stringName == 'uint64':
t = UInt64()
elif stringName == 'byte':
t = Byte()
elif stringName == 'sbyte':
t = SByte()
if xmlelement:
self.parseXML(xmlelement)
class UInt32(UInteger):
def __init__(self, xmlelement=None):
UInteger.__init__(self)
if xmlelement:
self.parseXML(xmlelement)
class Int64(Integer):
def __init__(self, xmlelement=None):
Integer.__init__(self)
if xmlelement:
self.parseXML(xmlelement)
class UInt64(UInteger):
def __init__(self, xmlelement=None):
UInteger.__init__(self)
if xmlelement:
self.parseXML(xmlelement)
class Float(Number):
def __init__(self, xmlelement=None):
Number.__init__(self)
if xmlelement:
Float.parseXML(self, xmlelement)
def parseXML(self, xmlvalue, namespaceMapping=None):
# Expect value or
# value
self.checkXML(xmlvalue)
val = getXmlTextTrimmed(xmlvalue.firstChild)
if xmlelement:
self.parseXML(xmlelement)
class SByte(Integer):
def __init__(self, xmlelement=None):
Integer.__init__(self)
if xmlelement:
self.parseXML(xmlelement)
class Int16(Integer):
def __init__(self, xmlelement=None):
Integer.__init__(self)
if xmlelement:
self.parseXML(xmlelement)
class UInt16(UInteger):
def __init__(self, xmlelement=None):
UInteger.__init__(self)
if xmlelement:
self.parseXML(xmlelement)
class Int32(Integer):
def __init__(self, xmlelement=None):
Integer.__init__(self)
if xmlelement:
self.parseXML(xmlelement)
class UInt32(UInteger):
def __init__(self, xmlelement=None):
UInteger.__init__(self)
if xmlelement:
self.parseXML(xmlelement)
val = getXmlTextTrimmed(xmlvalue.firstChild)
self.value = val if val is not None else 0
class Integer(Number):
def __init__(self, xmlelement=None):
Number.__init__(self)
if xmlelement:
self.parseXML(xmlelement)
class UInteger(Number):
def __init__(self, xmlelement=None):
Number.__init__(self)
if xmlelement:
self.parseXML(xmlelement)
class Byte(UInteger):
def __init__(self, xmlelement=None):
UInteger.__init__(self)
if xmlelement:
self.parseXML(xmlelement)
class SByte(Integer):
def __init__(self, xmlelement=None):
Integer.__init__(self)
if xmlelement:
self.parseXML(xmlelement)
class Int16(Integer):
def __init__(self, xmlelement=None):
Integer.__init__(self)
if xmlelement:
self.parseXML(xmlelement)
if xmlelement:
self.parseXML(xmlelement)
class UInt16(UInteger):
def __init__(self, xmlelement=None):
UInteger.__init__(self)
if xmlelement:
self.parseXML(xmlelement)
class Int32(Integer):
def __init__(self, xmlelement=None):
Integer.__init__(self)
if xmlelement:
self.parseXML(xmlelement)
class UInt32(UInteger):
def __init__(self, xmlelement=None):
UInteger.__init__(self)
if xmlelement:
self.parseXML(xmlelement)
class Int64(Integer):
def __init__(self, xmlelement=None):
Integer.__init__(self)
if xmlelement:
self.parseXML(xmlelement)
class UInt64(UInteger):
def __init__(self, xmlelement=None):
UInteger.__init__(self)
if xmlelement:
self.parseXML(xmlelement)
def __init__(self, xmlelement=None):
UInteger.__init__(self)
if xmlelement:
self.parseXML(xmlelement)