Hi Rhino folk.

I want to extend a Java class and override a protected method with a JS
function.  Here is a class:

  public class A {
    public String f()    { return g(); }
    protected String g() { return "default"; }
  }

And this is what I tried from JS:

  >>> importClass(Packages.A)
  undefined
  >>> x = new JavaAdapter(A, { g: function() { return 'overridden' } })
  [EMAIL PROTECTED]
  >>> x.f()
  default

So you can see that A.g() is being called, rather than the one on the
object I passed to the JavaAdapter constructor.

Is there a way I can get this to work?

Thanks,

Cameron

-- 
Cameron McCormack ≝ http://mcc.id.au/
_______________________________________________
dev-tech-js-engine-rhino mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-js-engine-rhino

Reply via email to