TypePopulator.populateMethod( ic, ic.getArity().getValue(),
TypePopulator.populateMethod( ic, ic.getArity().getValue(),
/** * Use reflection to provide a method handle based on an annotated Java * method. * * @see org.jruby.internal.runtime.methods.MethodFactory#getAnnotatedMethod */ public DynamicMethod getAnnotatedMethod(RubyModule implementationClass, JavaMethodDescriptor desc) { try { if (!Modifier.isPublic(desc.getDeclaringClass().getModifiers())) { LOG.warn("warning: binding non-public class {}; reflected handles won't work", desc.declaringClassName); } Method method = desc.getDeclaringClass().getDeclaredMethod(desc.name, desc.getParameterClasses()); JavaMethod ic = new ReflectedJavaMethod(implementationClass, method, desc.anno); TypePopulator.populateMethod( ic, ic.getArity().getValue(), method.getName(), Modifier.isStatic(method.getModifiers()), CallConfiguration.getCallConfigByAnno(desc.anno), desc.anno.notImplemented()); return ic; } catch (Exception e) { throw new RuntimeException(e); } }
/** * Use reflection to provide a method handle based on an annotated Java * method. * * @see org.jruby.internal.runtime.methods.MethodFactory#getAnnotatedMethod */ public DynamicMethod getAnnotatedMethod(RubyModule implementationClass, JavaMethodDescriptor desc) { try { if (!Modifier.isPublic(desc.getDeclaringClass().getModifiers())) { LOG.warn("warning: binding non-public class {}; reflected handles won't work", desc.declaringClassName); } Method method = desc.getDeclaringClass().getDeclaredMethod(desc.name, desc.getParameterClasses()); JavaMethod ic = new ReflectedJavaMethod(implementationClass, method, desc.anno); TypePopulator.populateMethod( ic, ic.getArity().getValue(), method.getName(), Modifier.isStatic(method.getModifiers()), CallConfiguration.getCallConfigByAnno(desc.anno), desc.anno.notImplemented()); return ic; } catch (Exception e) { throw new RuntimeException(e); } }
/** * Use code generation to provide a method handle based on an annotated Java * method. * * @see org.jruby.runtime.MethodFactory#getAnnotatedMethod */ public DynamicMethod getAnnotatedMethod(RubyModule implementationClass, JavaMethodDescriptor desc) { String javaMethodName = desc.name; try { Class c = getAnnotatedMethodClass(Arrays.asList(desc)); JavaMethod ic = (JavaMethod)c.getConstructor(new Class[]{RubyModule.class, Visibility.class}).newInstance(new Object[]{implementationClass, desc.anno.visibility()}); TypePopulator.populateMethod( ic, Arity.fromAnnotation(desc.anno, desc.actualRequired).getValue(), javaMethodName, desc.isStatic, CallConfiguration.getCallConfigByAnno(desc.anno), desc.anno.notImplemented(), desc.getDeclaringClass(), desc.name, desc.getReturnClass(), desc.getParameterClasses()); return ic; } catch(Exception e) { e.printStackTrace(); throw implementationClass.getRuntime().newLoadError(e.getMessage()); } }
/** * Use code generation to provide a method handle based on an annotated Java * method. * * @see org.jruby.runtime.MethodFactory#getAnnotatedMethod */ public DynamicMethod getAnnotatedMethod(RubyModule implementationClass, JavaMethodDescriptor desc) { String javaMethodName = desc.name; try { Class c = getAnnotatedMethodClass(Arrays.asList(desc)); JavaMethod ic = (JavaMethod)c.getConstructor(new Class[]{RubyModule.class, Visibility.class}).newInstance(new Object[]{implementationClass, desc.anno.visibility()}); TypePopulator.populateMethod( ic, Arity.fromAnnotation(desc.anno, desc.actualRequired).getValue(), javaMethodName, desc.isStatic, CallConfiguration.getCallConfigByAnno(desc.anno), desc.anno.notImplemented(), desc.getDeclaringClass(), desc.name, desc.getReturnClass(), desc.getParameterClasses()); return ic; } catch(Exception e) { e.printStackTrace(); throw implementationClass.getRuntime().newLoadError(e.getMessage()); } }
TypePopulator.populateMethod( ic, Arity.optional().getValue(),
TypePopulator.populateMethod( ic, Arity.optional().getValue(),
/** * Use code generation to provide a method handle based on an annotated Java * method. * * @see org.jruby.runtime.MethodFactory#getAnnotatedMethod */ public DynamicMethod getAnnotatedMethod(RubyModule implementationClass, JavaMethodDescriptor desc, String name) { String javaMethodName = desc.name; try { Class c = getAnnotatedMethodClass(Collections.singletonList(desc)); JavaMethod ic = constructJavaMethod(implementationClass, desc, name, c); TypePopulator.populateMethod( ic, Arity.fromAnnotation(desc.anno, desc.actualRequired).getValue(), javaMethodName, desc.isStatic, desc.anno.notImplemented(), desc.declaringClass, desc.name, desc.returnClass, desc.parameters); return ic; } catch(Exception e) { LOG.error(e); throw implementationClass.getRuntime().newLoadError(e.getMessage()); } }
/** * Use code generation to provide a method handle based on an annotated Java * method. * * @see org.jruby.runtime.MethodFactory#getAnnotatedMethod */ public DynamicMethod getAnnotatedMethod(RubyModule implementationClass, JavaMethodDescriptor desc, String name) { String javaMethodName = desc.name; try { Class c = getAnnotatedMethodClass(Collections.singletonList(desc)); JavaMethod ic = constructJavaMethod(implementationClass, desc, name, c); TypePopulator.populateMethod( ic, Arity.fromAnnotation(desc.anno, desc.actualRequired).getValue(), javaMethodName, desc.isStatic, desc.anno.notImplemented(), desc.declaringClass, desc.name, desc.returnClass, desc.parameters); return ic; } catch(Exception e) { LOG.error(e); throw implementationClass.getRuntime().newLoadError(e.getMessage()); } }
TypePopulator.populateMethod( ic, Arity.optional().getValue(),
TypePopulator.populateMethod( ic, Arity.optional().getValue(),