public void populate(final RubyModule target, final Class clazz) { assert clazz == this.clazz : "populator for " + this.clazz + " used for " + clazz; // fallback on non-pregenerated logic // populate method index; this is done statically in generated code AnnotationHelper.populateMethodIndex(clumper.readGroups, MethodIndex::addMethodReadFieldsPacked); AnnotationHelper.populateMethodIndex(clumper.writeGroups, MethodIndex::addMethodWriteFieldsPacked); final Ruby runtime = target.getRuntime(); final MethodFactory methodFactory = MethodFactory.createFactory(runtime.getJRubyClassLoader()); for (Map.Entry<String, List<JavaMethodDescriptor>> entry : clumper.getStaticAnnotatedMethods().entrySet()) { final String name = entry.getKey(); final List<JavaMethodDescriptor> methods = entry.getValue(); target.defineAnnotatedMethod(name, methods, methodFactory); addBoundMethodsUnlessOmitted(runtime, name, methods); } for (Map.Entry<String, List<JavaMethodDescriptor>> entry : clumper.getAnnotatedMethods().entrySet()) { final String name = entry.getKey(); final List<JavaMethodDescriptor> methods = entry.getValue(); target.defineAnnotatedMethod(name, methods, methodFactory); addBoundMethodsUnlessOmitted(runtime, name, methods); } }
public void populate(final RubyModule target, final Class clazz) { assert clazz == this.clazz : "populator for " + this.clazz + " used for " + clazz; // fallback on non-pregenerated logic // populate method index; this is done statically in generated code AnnotationHelper.populateMethodIndex(clumper.readGroups, MethodIndex::addMethodReadFieldsPacked); AnnotationHelper.populateMethodIndex(clumper.writeGroups, MethodIndex::addMethodWriteFieldsPacked); final Ruby runtime = target.getRuntime(); final MethodFactory methodFactory = MethodFactory.createFactory(runtime.getJRubyClassLoader()); for (Map.Entry<String, List<JavaMethodDescriptor>> entry : clumper.getStaticAnnotatedMethods().entrySet()) { final String name = entry.getKey(); final List<JavaMethodDescriptor> methods = entry.getValue(); target.defineAnnotatedMethod(name, methods, methodFactory); addBoundMethodsUnlessOmitted(runtime, name, methods); } for (Map.Entry<String, List<JavaMethodDescriptor>> entry : clumper.getAnnotatedMethods().entrySet()) { final String name = entry.getKey(); final List<JavaMethodDescriptor> methods = entry.getValue(); target.defineAnnotatedMethod(name, methods, methodFactory); addBoundMethodsUnlessOmitted(runtime, name, methods); } }