[rjb-users] rjb and enum type in Java

rjb-users at rubyforge.org rjb-users at rubyforge.org
Fri Oct 5 21:24:24 EDT 2007


Hi Marek

Your MyTypes enum is a nested class (the outer is OtherClass).
Javac names the nested class as outer$inner. So, you can write
Rjb::import('mylib.SomeClass$MyTypes'). 
Please see the directory that has your class files, and you can find
OtherClass$MyTypes.class file in it.

Cheers.

On Fri, 05 Oct 2007 21:39:54 +0200
rjb-users at rubyforge.orgさん wrote:

> Hi,
> 
> I try from few hours import enum type class into ruby. I have a Java
> class which is defined like:
> 
> package mylib;
> public class SomeClass extends OtherClass
> {
> 	public enum MyTypes
> 	{
> 		TYPEA, TYPEB,TYPEC
> 	};
> ...
> ...
> }
> 
> when I try to import "SomeClass" using:
> 
> Rjb.import('mylib.SomeClass.MyTypes')
> 
> I got only "NoClassDefFoundError"
> 
> using this:
> 
> c=Rjb.import('mylib.SomeClass')
> a=c.MyTypes
> 
> gives me:
> RuntimeError: Fail: unknown method name `MyTypes'
> 
> 
> Please, help me. Is that any way to import enum type?
> 
> Marek

-- 
arton



More information about the rjb-users mailing list