posted 16 years ago
Greetings!
Ladys and Gentlemen, I need help with Java Scripting API.
I want to be able to manipulate fields and methods of instance of my class via embedded Javascript Rhino Engine. To do this I have written the following:
Unfortunately this doesn't work: it prints 'undefined'. But if I replace MyClass with ArrayList for example, the sane scheme works. I mean that I can get the size of my ArrayList by ArrayList.size(), for example. If object of my own class is put into the Engine the situatuin is different: I can't use its fields and methods.
If I evaluate the following: 'for (i in mc) { print(i + '\n ') }' it prints all the methods that respond to Object class, but not methods from MyClass.
So, as far as I understand, the problem is with my own class. Probably I must import it somehow to the Engine? Please, help.