def mapEnumeration(self, prop, label, value):
     javaenum = {}
     enumtype = self.javaType(prop.type())
     javaenum['javatype'] = enumtype
     javaenum['javalabel'] = java.identifier(label)
     javaenum['javavalue'] = java.literal(value, enumtype, prop.isComplex())
     return javaenum
Beispiel #2
0
 def mapSimpleSequenceProperty(self, prop):
     javaprop, javatype = self._createComplexJavaProp(prop)
     values = []
     if prop.hasValue():
         for value in prop.value():
             values.append(
                 java.literal(value, javatype, complex=prop.isComplex()))
     javaprop['javavalues'] = values
     javaprop['isOptional'] = prop.isOptional()
     return javaprop
 def mapStructValue(self, structdef, value):
     newval = []
     for field in structdef['fields']:
         identifier = field['identifier']
         if identifier in value:
             itemvalue = value[identifier]
         else:
             itemvalue = field.get('value', None)
         if itemvalue is not None:
             if isinstance(itemvalue, list):
                 vals = []
                 for val in itemvalue:
                     vals.append(java.literal(val, field['javatype']))
                 addval = field['javaclass']+'SequenceProperty.asList('+','.join(vals)+')'
                 newval.append(addval)
             else:
                 newval.append(java.literal(itemvalue, field['javatype']))
         else:
             newval.append(java.NULL)
     return newval
    def mapSimpleSequenceProperty(self, prop):
        javaprop, javatype = self._createComplexJavaProp(prop)
	values = []
        if prop.hasValue():
            for value in prop.value(): 
                values.append(java.literal(value,
                                           javatype,
                                           complex = prop.isComplex()))
	javaprop['javavalues'] = values
        javaprop['isOptional'] = prop.isOptional()
        return javaprop
    def mapSimpleProperty(self, prop):
        javaprop, javatype = self._createComplexJavaProp(prop)

        if prop.hasValue():
            value = java.literal(prop.value(), 
                                 javatype, 
                                 complex = prop.isComplex())
        else:
            value = java.NULL
        javaprop['javavalue'] = value
        javaprop['isOptional'] = prop.isOptional()
        return javaprop
Beispiel #6
0
    def mapSimpleProperty(self, prop):
        javaprop, javatype = self._createComplexJavaProp(prop)

        if prop.hasValue():
            value = java.literal(prop.value(),
                                 javatype,
                                 complex=prop.isComplex())
        else:
            value = java.NULL
        javaprop['javavalue'] = value
        javaprop['isOptional'] = prop.isOptional()
        return javaprop
Beispiel #7
0
 def mapStructValue(self, structdef, value):
     newval = []
     for field in structdef['fields']:
         identifier = field['identifier']
         if identifier in value:
             itemvalue = value[identifier]
         else:
             itemvalue = field.get('value', None)
         if itemvalue is not None:
             if isinstance(itemvalue, list):
                 vals = []
                 for val in itemvalue:
                     vals.append(java.literal(val, field['javatype']))
                 addval = field[
                     'javaclass'] + 'SequenceProperty.asList(' + ','.join(
                         vals) + ')'
                 newval.append(addval)
             else:
                 newval.append(java.literal(itemvalue, field['javatype']))
         else:
             newval.append(java.NULL)
     return newval
 def mapStructValue(self, structdef, value):
     newval = []
     for field in structdef['fields']:
         identifier = field['identifier']
         if identifier in value:
             itemvalue = value[identifier]
         else:
             itemvalue = field.get('value', None)
         if itemvalue is not None:
             newval.append(java.literal(itemvalue, field['javatype']))
         else:
             newval.append(java.NULL)
     return newval