def get_fields_and_parameters_from_iterator(parameters):
    iterator = J.call(parameters, 'iterator', 
                      '()L%(ITERATOR_CLASS)s;' % globals())
    
    result = []
    for jfield in J.iterate_java(iterator):
        field = J.get_field_wrapper(jfield)
        parameter = field.getAnnotation(PARAMETER_CLASS.replace('/','.'))
        if parameter is not None:
            parameter = get_parameter_wrapper(parameter)
            result.append((field, parameter))
    return result
Example #2
0
def get_fields_and_parameters_from_iterator(parameters):
    iterator = J.call(parameters, 'iterator',
                      '()L%(ITERATOR_CLASS)s;' % globals())

    result = []
    for jfield in J.iterate_java(iterator):
        field = J.get_field_wrapper(jfield)
        parameter = field.getAnnotation(PARAMETER_CLASS.replace('/', '.'))
        if parameter is not None:
            parameter = get_parameter_wrapper(parameter)
            result.append((field, parameter))
    return result
Example #3
0
 def test_04_03_field_type(self):
     c = J.get_class_wrapper('java.lang.Byte')
     f = J.get_field_wrapper(c.getField('MAX_VALUE'))
     t = f.getType()
     self.assertEqual(J.to_string(t), 'byte')
Example #4
0
 def test_04_02_field_name(self):
     c = J.get_class_wrapper('java.lang.Byte')
     f = J.get_field_wrapper(c.getField('MAX_VALUE'))
     self.assertEqual(f.getName(), 'MAX_VALUE')
Example #5
0
 def test_04_01_field_get(self):
     c = J.get_class_wrapper('java.lang.Byte')
     f = J.get_field_wrapper(c.getField('MAX_VALUE'))
     v = f.get(None)
     self.assertEqual(J.to_string(v), '127')
Example #6
0
 def test_04_03_field_type(self):
     c = J.get_class_wrapper('java.lang.Byte')
     f = J.get_field_wrapper(c.getField('MAX_VALUE'))
     t = f.getType()
     self.assertEqual(J.to_string(t), 'byte')
Example #7
0
 def test_04_02_field_name(self):
     c = J.get_class_wrapper('java.lang.Byte')
     f = J.get_field_wrapper(c.getField('MAX_VALUE'))
     self.assertEqual(f.getName(), 'MAX_VALUE')
Example #8
0
 def test_04_01_field_get(self):
     c = J.get_class_wrapper('java.lang.Byte')
     f = J.get_field_wrapper(c.getField('MAX_VALUE'))
     v = f.get(None)
     self.assertEqual(J.to_string(v), '127')