我試圖將一些java移植到jruby,並且它使用了Bean PropertyDescriptor。原來的代碼是:使用JRuby創建bean PropertyDescriptor
new PropertyDescriptor("splitEvaluator", CrossValidationResultProducer.class)
,我一直在努力,端口:
PropertyDescriptor.new("splitEvaluator", CrossValidationResultProducer)
但是,我得到的錯誤:
no constructor with arguments matching [class org.jruby.RubyString, class org.jruby.RubyClass] on object #<Java::JavaBeans::PropertyDescriptor:0x86f847> (NameError)
的PropertyDescriptor API說,第二個參數應該是一個Java類。我需要通過什麼才能在JRuby中工作?
謝謝,尼克。如果方法期望自動轉換爲Java類,那麼知道是否有任何缺點是很有趣的。 – michaeltwofish 2010-08-14 05:02:31