def _translate_class_fields(self, clsobj, OOTYPE): for fieldnm, (FIELDOOTY, fielddef) in OOTYPE._fields.iteritems(): if FIELDOOTY is ootype.Void: continue fieldty = self.lltype_to_cts(FIELDOOTY) clsobj.add_field( jvm.Field(clsobj.name, fieldnm, fieldty, False, FIELDOOTY), fielddef)
def __init__(self, name, super_class, bound_to_jty, impl_method): JvmGeneratedClassType.__init__(self, name) self.super_class = super_class self.impl_method = impl_method self.dump_method = ConstantStringDumpMethod( self, "StaticMethodImplementation") if bound_to_jty: self.bound_to_jty = bound_to_jty self.bound_to_fld = jvm.Field(self.name, 'bound_to', bound_to_jty, False) self.bind_method = jvm.Method.s(self, 'bind', (self.bound_to_jty, ), self) else: self.bound_to_jty = None self.bound_to_fld = None self.bind_method = None
def lookup_field(self, fieldnm): """ Given a field name, returns a jvm.Field object """ _, FIELDTY = self.OOTYPE._lookup_field(fieldnm) jfieldty = self.db.lltype_to_cts(FIELDTY) return jvm.Field( self.descriptor.class_name(), fieldnm, jfieldty, False)