From: SAKURAI Masashi Date: 2005-10-29T12:59:44+09:00 Subject: Re: Java Reflection in Ruby Hi, > For part of an application I'm working on I am looking to use Java > Reflection to get method information from a .class file. Using yajb (http://raa.ruby-lang.org/project/yajb/), you can use Java Reflection API from ruby (attached code). If you want to build a Class object from a byte array, you need to implement the custom class loader in Java. Although yajb can make a subclass of any class in Java, I can not show the implementation of java.lang.ClassLoader on yajb, because of a bug of yajb. I'm going to fix it. ###### require 'yajb/jbridge' include JavaBridge jimport 'java.io.*' klass = :String.jclass.getClass puts klass.getName puts "=====================(field)" klass.getDeclaredFields.each {|i| puts i.getName } puts "=====================(method)" klass.getDeclaredMethods.each {|i| puts i.getName } -- SAKURAI, Masashi (family, given) m.sakurai@dream.com