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

Alias class names

0 views
Skip to first unread message

Daryl Stultz

unread,
Dec 31, 2009, 9:36:27 AM12/31/09
to Rhino JS User List
Hello,

I'm familiar with this:

ScriptableObject.defineClass(scope, long.path.name.MyEntity.class);

which puts MyEntity at the top level, perhaps with a name "Entity". MyEntity
must be Scriptable. I'd like to do the same with classes that aren't
scriptable. Currently I stick code at the front like so:

String imports = "Entity = Packages." +
long.path.name.MyEntity.class.getName() + ";\n";
String fullScript = import + originalScript;
executeScript(fullScript);

Kinda gross. I think I'd like to do something like this:

ScriptableObject.putProperty(scope, "Entity", yaddayadda);

but I don't know what to put in for yaddayadda to reference the class.
Anyone know?

Thanks.

--Daryl Stultz
_____________________________________
6 Degrees Software and Consulting, Inc.
http://www.6degrees.com
mailto:da...@6degrees.com

0 new messages