Examples of DynamicMethod


Examples of org.jruby.internal.runtime.methods.DynamicMethod

        }
        return method;
    }
   
    public static DynamicMethod searchMethod(RubyClass clazz, String name1, String name2, String name3) {
        DynamicMethod method = clazz.searchMethod(name1);
        if (method == UndefinedMethod.INSTANCE) {
            return searchMethod(clazz, name2, name3);
        }
        return method;
    }
View Full Code Here

Examples of org.jruby.internal.runtime.methods.DynamicMethod

        }
        return method;
    }
   
    public static DynamicMethod searchMethod(RubyClass clazz, String name1, String name2, String name3, String name4) {
        DynamicMethod method = clazz.searchMethod(name1);
        if (method == UndefinedMethod.INSTANCE) {
            return searchMethod(clazz, name2, name3, name4);
        }
        return method;
    }
View Full Code Here

Examples of org.jruby.internal.runtime.methods.DynamicMethod

        }
        return method;
    }
   
    public static DynamicMethod searchMethod(RubyClass clazz, String name1, String name2, String name3, String name4, String name5) {
        DynamicMethod method = clazz.searchMethod(name1);
        if (method == UndefinedMethod.INSTANCE) {
            return searchMethod(clazz, name2, name3, name4, name5);
        }
        return method;
    }
View Full Code Here

Examples of org.jruby.internal.runtime.methods.DynamicMethod

        }
        return method;
    }
   
    public static DynamicMethod searchMethod(RubyClass clazz, String name1, String name2, String name3, String name4, String name5, String name6) {
        DynamicMethod method = clazz.searchMethod(name1);
        if (method == UndefinedMethod.INSTANCE) {
            return searchMethod(clazz, name2, name3, name4, name5, name6);
        }
        return method;
    }
View Full Code Here

Examples of org.jruby.internal.runtime.methods.DynamicMethod

        }
        return method;
    }
   
    public static DynamicMethod searchMethod(RubyClass clazz, String name1, String name2, String name3, String name4, String name5, String name6, String name7) {
        DynamicMethod method = clazz.searchMethod(name1);
        if (method == UndefinedMethod.INSTANCE) {
            return searchMethod(clazz, name2, name3, name4, name5, name6, name7);
        }
        return method;
    }
View Full Code Here

Examples of org.jruby.internal.runtime.methods.DynamicMethod

        }
        return method;
    }
   
    public static DynamicMethod searchMethod(RubyClass clazz, String name1, String name2, String name3, String name4, String name5, String name6, String name7, String name8) {
        DynamicMethod method = clazz.searchMethod(name1);
        if (method == UndefinedMethod.INSTANCE) {
            return searchMethod(clazz, name2, name3, name4, name5, name6, name7, name8);
        }
        return method;
    }
View Full Code Here

Examples of org.jruby.internal.runtime.methods.DynamicMethod

        RubyModule targetModule = (RubyModule)clazz;
        JavaClass javaClass = (JavaClass)self.getInstanceVariables().fastGetInstanceVariable("@java_class");
       
        Method[] javaInstanceMethods = javaClass.javaClass().getMethods();
        DynamicMethod dummyMethod = new org.jruby.internal.runtime.methods.JavaMethod(targetModule, Visibility.PUBLIC) {
            @Override
            public IRubyObject call(ThreadContext context, IRubyObject self, RubyModule clazz, String name, IRubyObject[] args, Block block) {
                // dummy bodies for default impls
                return context.getRuntime().getNil();
            }
View Full Code Here

Examples of org.jruby.internal.runtime.methods.DynamicMethod

                // list of interfaces we implement
                singleton.addReadAttribute(context, "java_interfaces");
               
                // We capture the original "new" and make it private
                DynamicMethod newMethod = singleton.searchMethod("new").dup();
                singleton.addMethod("__jredef_new", newMethod);
                newMethod.setVisibility(Visibility.PRIVATE);

                // The replacement "new" allocates and inits the Ruby object as before, but
                // also instantiates our proxified Java object by calling __jcreate!
                singleton.addMethod("new", new org.jruby.internal.runtime.methods.JavaMethod(singleton, Visibility.PUBLIC) {
                    @Override
View Full Code Here

Examples of org.jruby.internal.runtime.methods.DynamicMethod

            }
        });
       
        RubyClass singleton = concreteJavaProxy.getSingletonClass();
       
        final DynamicMethod oldNew = singleton.searchMethod("new");
       
        singleton.addMethod("new", new ConcreteNewMethod(singleton, Visibility.PUBLIC, oldNew));
       
        concreteJavaProxy.addMethod("initialize", new org.jruby.internal.runtime.methods.JavaMethod(concreteJavaProxy, Visibility.PUBLIC) {
            @Override
View Full Code Here

Examples of org.jruby.internal.runtime.methods.DynamicMethod

     * @param methodName The ruby name to attach the function as.
     */
    @JRubyMethod(name="attach")
    public IRubyObject attach(ThreadContext context, IRubyObject module, IRubyObject methodName) {

        DynamicMethod m = createDynamicMethod((RubyModule) module);
        ((RubyModule) module).addMethod(methodName.asJavaString(), m);
        return context.getRuntime().getNil();
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.