73 primitive string type, you can only rely on it being a {@code java.lang.CharSequence}, and if the value is a number, you
74 can only rely on it being a {@code java.lang.Number}. If the Java method declared parameter type is more specific (e.g.
75 {@code java.lang.String} or {@code java.lang.Double}), then Nashorn will of course ensure the required type is passed.
76 <h2>SAM types</h2>
77 As a special extension when invoking Java methods, ECMAScript function objects can be passed in place of an argument
78 whose Java type is so-called "single abstract method" or "SAM" type. While this name usually covers single-method
79 interfaces, Nashorn is a bit more versatile, and it recognizes a type as a SAM type if all its abstract methods are
80 overloads of the same name, and it is either an interface, or it is an abstract class with
81 a no-arg constructor. The type itself must be public, while the constructor and the methods can be either public or
82 protected. If there are multiple abstract overloads of the same name, the single function will serve as the shared
83 implementation for all of them, <em>and additionally it will also override any non-abstract methods of the same name</em>.
84 This is done to be consistent with the fact that ECMAScript does not have the concept of overloaded methods.
85 <h2>The {@code Java} object</h2>
86 Nashorn exposes a non-standard global object named {@code Java} that is the primary API entry point into Java
87 platform-specific functionality. You can use it to create instances of Java classes, convert from Java arrays to native
88 arrays and back, and so on.
89 <h2>Other non-standard built-in objects</h2>
90 In addition to {@code Java}, Nashorn also exposes some other non-standard built-in objects:
91 {@code JSAdapter}, {@code JavaImporter}, {@code Packages}
92
93 @since 9
94 */
95 module jdk.scripting.nashorn {
96 requires java.logging;
97 requires transitive java.scripting;
98 requires jdk.dynalink;
99
100 exports jdk.nashorn.api.scripting;
101 exports jdk.nashorn.api.tree;
102
103 exports jdk.nashorn.internal.runtime to
104 jdk.scripting.nashorn.shell;
105 exports jdk.nashorn.internal.objects to
106 jdk.scripting.nashorn.shell;
107 exports jdk.nashorn.tools to
108 jdk.scripting.nashorn.shell;
109
110 provides javax.script.ScriptEngineFactory
111 with jdk.nashorn.api.scripting.NashornScriptEngineFactory;
112
|
73 primitive string type, you can only rely on it being a {@code java.lang.CharSequence}, and if the value is a number, you
74 can only rely on it being a {@code java.lang.Number}. If the Java method declared parameter type is more specific (e.g.
75 {@code java.lang.String} or {@code java.lang.Double}), then Nashorn will of course ensure the required type is passed.
76 <h2>SAM types</h2>
77 As a special extension when invoking Java methods, ECMAScript function objects can be passed in place of an argument
78 whose Java type is so-called "single abstract method" or "SAM" type. While this name usually covers single-method
79 interfaces, Nashorn is a bit more versatile, and it recognizes a type as a SAM type if all its abstract methods are
80 overloads of the same name, and it is either an interface, or it is an abstract class with
81 a no-arg constructor. The type itself must be public, while the constructor and the methods can be either public or
82 protected. If there are multiple abstract overloads of the same name, the single function will serve as the shared
83 implementation for all of them, <em>and additionally it will also override any non-abstract methods of the same name</em>.
84 This is done to be consistent with the fact that ECMAScript does not have the concept of overloaded methods.
85 <h2>The {@code Java} object</h2>
86 Nashorn exposes a non-standard global object named {@code Java} that is the primary API entry point into Java
87 platform-specific functionality. You can use it to create instances of Java classes, convert from Java arrays to native
88 arrays and back, and so on.
89 <h2>Other non-standard built-in objects</h2>
90 In addition to {@code Java}, Nashorn also exposes some other non-standard built-in objects:
91 {@code JSAdapter}, {@code JavaImporter}, {@code Packages}
92
93 @moduleGraph
94 @since 9
95 */
96 module jdk.scripting.nashorn {
97 requires java.logging;
98 requires transitive java.scripting;
99 requires jdk.dynalink;
100
101 exports jdk.nashorn.api.scripting;
102 exports jdk.nashorn.api.tree;
103
104 exports jdk.nashorn.internal.runtime to
105 jdk.scripting.nashorn.shell;
106 exports jdk.nashorn.internal.objects to
107 jdk.scripting.nashorn.shell;
108 exports jdk.nashorn.tools to
109 jdk.scripting.nashorn.shell;
110
111 provides javax.script.ScriptEngineFactory
112 with jdk.nashorn.api.scripting.NashornScriptEngineFactory;
113
|