Top Level Namespace

Defined Under Namespace

Modules: Kernel, Rjb, RjbConf Classes: JavaPackage

Class Method Summary collapse

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missingObject

Class Method Details

.class_evalObject

Rjb's class is not Class but Object, so add class_eval for the Java class.



# File 'ext/rjb.c'

static VALUE rjb_class_eval(int argc, VALUE* argv, VALUE self)
{
if (rb_block_given_p())
{
    rb_ivar_set(self, user_initialize, rb_block_proc());
}

.ctor_sigsObject

.newObject

.new_with_sigObject

new instance with signature



# File 'ext/rjb.c'

static VALUE rjb_newinstance_s(int argc, VALUE* argv, VALUE self)
{
    VALUE vsig, rest;
    char* sig;
    VALUE ret = Qnil;
    struct jv_data* ptr;
    int found = 0;
    JNIEnv* jenv = rjb_prelude();

    rb_scan_args(argc, argv, "1*", &vsig, &rest);
    sig = StringValueCStr(vsig);
    Data_Get_Struct(self, struct jv_data, ptr);
    if (ptr->constructors)
    {
    struct cls_constructor** pc = ptr->constructors;
    for (pc = ptr->constructors; *pc; pc++)
    {
if ((*pc)->arg_count == argc - 1
&& !strcmp(sig, (*pc)->method_signature))
{
    found = 1;
ret = createinstance(jenv, argc - 1, argv + 1, self, *pc);
break;
}

.sigsObject

.static_sigsObject

Instance Method Details

#_classnameObject

return class name



# File 'ext/rjb.c'

static VALUE rjb_i_class(VALUE self)
{
    JNIEnv* jenv = rjb_attach_current_thread();
    struct jvi_data* ptr;
    jstring nm;
    Data_Get_Struct(self, struct jvi_data, ptr);
    nm = (*jenv)->CallObjectMethod(jenv, ptr->klass, rjb_class_getName);
    rjb_check_exception(jenv, 0);
    return jstring2val(jenv, nm);
}

#_invokeObject

#_prepare_proxyObject

#implObject

#initializeObject

#javaObject



126
127
128
# File 'lib/rjbextension.rb', line 126

def java
  RjbConf::JAVA
end

#orgObject



122
123
124
# File 'lib/rjbextension.rb', line 122

def org
  RjbConf::ORG
end