Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to instantiate java inner class from rhino?

105 views
Skip to first unread message

Someone

unread,
Mar 4, 2010, 4:14:04 AM3/4/10
to
Hello,

while working with rhino i have to make use of some given java
objects. Unfortunatly these objects have a quite strange design and so
i ran into the following problem: How to instantiate a java inner
class from within rhino scripting?

In pure Java it is

OuterClass.InnerClass innerObject = outerObject.new InnerClass();

but when i try something similar with rhino it fails

importClass(org.some.Class);
importClass(org.some.Class.Inner);
var class = new Class();
var inner = class.new Inner();

I was searching the docs but couldnt figure if it is possible at all?

Thank you very much for your suggestions.

0 new messages