def __init__(self, name, supercls=None): """ 'name' should be a fully qualified Java class name like "java.lang.String", supercls is a Class object """ JvmGeneratedClassType.__init__(self, name) self.rendered = False # has rendering occurred? self.fields = {} # maps field name to jvm.Field object self.interfaces = [] # list of JvmTypes self.methods = {} # maps method name to a Function object* self.abstract_methods = {} # maps method name to jvm.Method object self.set_super_class(supercls)
def __init__(self, name, jargtypes, jrettype): """ argtypes: list of JvmTypes rettype: JvmType """ JvmGeneratedClassType.__init__(self, name) assert isinstance(jrettype, JvmType) self.java_argument_types = [self] + list(jargtypes) self.java_return_type = jrettype self.dump_method = ConstantStringDumpMethod( self, "StaticMethodInterface") self.invoke_method_obj = jvm.Method.v( self, 'invoke', self.java_argument_types[1:], self.java_return_type)
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