Re: Extending a Java class

2018-10-03 Thread Sundararajan Athijegannathan
protected methods of super class are made public in the generated script subclass. Java.super should have worked. If you can submit a simpler test case, it may be possible to see what's happening.. Thanks -Sundar On 02/10/18, 3:52 PM, Axel Dörfler wrote: Hi Sundar, Am 01/10/2018 um 05:00

Re: Extending a Java class

2018-10-02 Thread Axel Dörfler
Hi Sundar, Am 01/10/2018 um 05:00 schrieb Sundararajan Athijegannathan: In your example, it seems you're trying to add a new method to the subtype created in script. That is not supported. You can override existing methods of superclass  - but not add a new method to the Java type. Bummer!

Re: Extending a Java class

2018-09-30 Thread Sundararajan Athijegannathan
Hi, In your example, it seems you're trying to add a new method to the subtype created in script. That is not supported. You can override existing methods of superclass - but not add a new method to the Java type. Note that all super methods (including protected ones) are available via

Re: Extending a Java class

2018-09-28 Thread Axel Dörfler
Am 28/09/2018 um 11:34 schrieb Sundararajan Athijegannathan: It is hard to say what went wrong without looking at your full sample/test. Openjdk wiki page explains Java.extend function is here: http://hg.openjdk.java.net/jdk/jdk/file/7bd8d6b011c9/src/sample/nashorn/resourcetrysuggester.js

Extending a Java class

2018-09-27 Thread Axel Dörfler
Hi there, I'm trying to extend an Abstract java base class, and add a new method to it. However, that doesn't seem to work. I've tried it like this: var object = Java.extend(MyType, { newFunction: function(argument) { ... } }); And that: MyType.newFunction =