@Retention(value=CLASS) @Target(value={METHOD,CONSTRUCTOR}) public @interface JavaScriptBody
| Modifier and Type | Required Element and Description |
|---|---|
String[] |
args
Names of parameters for the method generated method that can
be referenced from
body(). |
String |
body
The actual body of the method in JavaScript.
|
| Modifier and Type | Optional Element and Description |
|---|---|
boolean |
javacall
Should a special syntax for calling back into Java object be turned on?
|
public abstract String[] args
body().public abstract String body
this.args() and possibly
thispublic abstract boolean javacall
@ followed by fully qualified
package name of the class. Now followed by :: and a method in
the class followed by its parameters enclosed inside (...).
This is the syntax one can use to call run()
method of Runnable:
r.@java.lang.Runnable::run()(). One can also call static methods. Just use:
var ten = @java.lang.Integer::parseInt(Ljava/lang/String;)("10")Copyright © 2014 NetBeans. All Rights Reserved.