Package org.jruby.anno

Examples of org.jruby.anno.JavaMethodDescriptor


            }
        }
    };
   
    public boolean defineAnnotatedMethod(String name, List<JavaMethodDescriptor> methods, MethodFactory methodFactory) {
        JavaMethodDescriptor desc = methods.get(0);
        if (methods.size() == 1) {
            return defineAnnotatedMethod(desc, methodFactory);
        } else {
            DynamicMethod dynamicMethod = methodFactory.getAnnotatedMethod(this, methods);
            methodDefiningCallback.define(this, desc, dynamicMethod);
View Full Code Here


        if (jrubyMethod == null) return false;

            if(jrubyMethod.compat() == CompatVersion.BOTH ||
                    getRuntime().getInstanceConfig().getCompatVersion() == jrubyMethod.compat()) {
            JavaMethodDescriptor desc = new JavaMethodDescriptor(method);
            DynamicMethod dynamicMethod = methodFactory.getAnnotatedMethod(this, desc);
            methodDefiningCallback.define(this, desc, dynamicMethod);

            return true;
        }
View Full Code Here

        for (Method method : methods) {
            JRubyMethod jrubyMethod = method.getAnnotation(JRubyMethod.class);

            if (jrubyMethod == null) continue;
           
            callback.define(implementationClass, new JavaMethodDescriptor(method), getAnnotatedMethod(implementationClass, new JavaMethodDescriptor(method)));
        }
    }
View Full Code Here

     * method.
     *
     * @see org.jruby.internal.runtime.methods.MethodFactory#getAnnotatedMethod
     */
    public DynamicMethod getAnnotatedMethod(RubyModule implementationClass, List<JavaMethodDescriptor> descs) {
        JavaMethodDescriptor desc1 = descs.get(0);
        String javaMethodName = desc1.name;
       
        if (DEBUG) out.println("Binding multiple: " + desc1.declaringClassName + "." + javaMethodName);
       
        synchronized (classLoader) {
View Full Code Here

        if (descs.size() == 1) {
            // simple path, no multimethod
            return getAnnotatedMethodClass(descs.get(0));
        }
       
        JavaMethodDescriptor desc1 = descs.get(0);
        String javaMethodName = desc1.name;
       
        if (DEBUG) out.println("Binding multiple: " + desc1.declaringClassName + "." + javaMethodName);
       
        String generatedClassName = CodegenUtils.getAnnotatedBindingClassName(javaMethodName, desc1.declaringClassName, desc1.isStatic, desc1.actualRequired, desc1.optional, true, desc1.anno.frame());
View Full Code Here

                    ic.setArity(Arity.fromAnnotation(jrubyMethod));
                    ic.setJavaName(method.getName());
                    ic.setSingleton(Modifier.isStatic(method.getModifiers()));
                    ic.setCallConfig(CallConfiguration.getCallConfigByAnno(jrubyMethod));

                    callback.define(implementationClass, new JavaMethodDescriptor(method), ic);
                }
            } catch(Exception e) {
                e.printStackTrace();
                throw implementationClass.getRuntime().newLoadError(e.getMessage());
            }
View Full Code Here

        SkinnyMethodAdapter mv = new SkinnyMethodAdapter(cw.visitMethod(ACC_PUBLIC, methodName, COMPILED_CALL_SIG_BLOCK, null, null));
        mv.visitCode();
        Label line = new Label();
        mv.visitLineNumber(0, line);
        // TODO: indexed methods do not use specific arity yet
        createAnnotatedMethodInvocation(new JavaMethodDescriptor(method), mv, superClass, -1, true);
        endMethod(mv);
       
        return methodName;
    }
View Full Code Here

            Method[] declaredMethods = cls.getDeclaredMethods();
            for (Method method: declaredMethods) {
                JRubyMethod anno = method.getAnnotation(JRubyMethod.class);
                if (anno == null) continue;
               
                JavaMethodDescriptor desc = new JavaMethodDescriptor(method);
               
                String name = anno.name().length == 0 ? method.getName() : anno.name()[0];
               
                List<JavaMethodDescriptor> methodDescs;
                Map<String, List<JavaMethodDescriptor>> methodsHash = null;
View Full Code Here

            Method[] declaredMethods = cls.getDeclaredMethods();
            for (Method method: declaredMethods) {
                JRubyMethod anno = method.getAnnotation(JRubyMethod.class);
                if (anno == null) continue;
               
                JavaMethodDescriptor desc = new JavaMethodDescriptor(method);
               
                String name = anno.name().length == 0 ? method.getName() : anno.name()[0];
               
                List<JavaMethodDescriptor> methodDescs;
                Map<String, List<JavaMethodDescriptor>> methodsHash = null;
View Full Code Here

       
        populator.populate(this, clazz);
    }
   
    public boolean defineAnnotatedMethod(String name, List<JavaMethodDescriptor> methods, MethodFactory methodFactory) {
        JavaMethodDescriptor desc = methods.get(0);
        if (methods.size() == 1) {
            return defineAnnotatedMethod(desc, methodFactory);
        } else {
            DynamicMethod dynamicMethod = methodFactory.getAnnotatedMethod(this, methods);
            define(this, desc, dynamicMethod);
View Full Code Here

TOP

Related Classes of org.jruby.anno.JavaMethodDescriptor

Copyright © 2018 www.massapicom. 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.