[Objectscript-users] retrieve full package from Value
Brought to you by:
rob_d_clark
From: <ar...@va...> - 2005-11-03 12:53:51
|
Hi, I'm working on an application having the Oscript interpreter embedded. I have a Java helper class that calls a function in a scripted object. This function returns another scripted object back to the Java helper. How can i get the full package name from that Value (Scope)-object? Example: lib/someobject.os: public function someobject() { public function test() { } } lib/file.os: public function file() { public function method() { return new pkg.lib.someobject(); <=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D } } Java helper class: AbstractFile sFile =3D OscriptInterpreter.resolve("lib/file.os", false); OscriptInterpreter.eval(sFile, pScope); Value objValue =3D pScope.lookupInScope("file"); Value program =3D objValue.callAsConstructor(new Value[0]); Value func =3D program.lookupInScope("method"); Value res =3D func.callAsFunction(); <=3D=3D=3D "res" now contains the instantiated "pkg.lib.someobject()" object. But how do i retrieve this information from that Value-object? How do i know the package name and th= e object name of this Value object? I hope my question is clear enough. Thanks for your help. Regards, Arjen van Efferen |