Hi.
  I have a class Window, which is just like this
 public class Window extends ScriptableObject{
         private Window scope;
         private int status;
         public Window() {
                 scope = this;
         }
         public String getClassName() { return "Window"; }
         public void jsConstructor() {
                scope = this;
            }
        public void jsFunction_alert(String message){
        System.out.println("Window.jsFunction_alert -> "+ message);
    }
  public Window jsGet_scope() { return scope; }
  public void jsSet_scope(Window scope) { this.scope = scope; }
  public int jsGet_status() { return status; }
  public void jsSet_status(int status) {
          System.out.println("Window.jsSet_status -> "+ status);
          this.status = status;
          }
}  .

Then I write some code
            ......................
             Window window = new Window ();
             Scriptable scope = cx.initStandardObjects(window );
             ................. denoted as codeA .
Now I want to  visit the "status" or "scope" directly, but I have to
miss the defining
code( ScriptableObject.defineClass(scope,Window .class); ) since I
have not got a scope,  my attempt fails.
Maybe I can override the "get" and "put" methods of the
"ScriptableObject" class,  but it violates attribute access  rule in
Rhino, so it's not suitable for my system!
so How can I deal with this problem with using "defineClass" method
Thank you
_______________________________________________
dev-tech-js-engine-rhino mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-js-engine-rhino

Reply via email to