• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

META-INF/services/H17-Apr-2020-65

ArrayStreamLinkerExporter.javaH A D17-Apr-20205.3 KiB12275

BufferIndexingLinkerExporter.javaH A D17-Apr-202011 KiB250196

DOMLinkerExporter.javaH A D17-Apr-20207.2 KiB163104

MissingMethodExample.javaH A D17-Apr-20202.3 KiB5415

MissingMethodHandler.javaH A D17-Apr-20201.8 KiB383

MissingMethodLinkerExporter.javaH A D17-Apr-20208.4 KiB179104

READMEH A D17-Apr-20202.1 KiB4633

UnderscoreNameLinkerExporter.javaH A D17-Apr-20204.9 KiB10860

README

1This directory contains samples for Dynalink API (http://openjdk.java.net/jeps/276).
2These samples require a jar file to be built and such jars be placed in the
3classpath of the jjs tool. Linker samples are named with the naming pattern
4"xyz_linker.js". These scripts build dynalink linker jar from java code and exec
5another jjs process with appropriate classpath set.
6
7Dynalink samples:
8
9* array_stream_linker.js
10
11This sample builds ArrayStreamLinkerExporter.java and uses it in a sample script
12called "array_stream.js". This linker adds "stream" property to Java array
13objects. The "stream" property returns appropriate Stream type for the given
14Java array (IntStream, DoubleStream ...).
15
16* buffer_indexing_linker.js
17
18This sample builds BufferIndexingLinkerExporter.java and uses it in a sample script
19called "buffer_index.js". This linker adds array-like indexed access, indexed assignment
20and "length" property to Java NIO Buffer objects. Script can treat NIO Buffer objects
21as if those are just array objects.
22
23* dom_linker.js
24
25This sample builds DOMLinkerExporter.java and uses it in a sample script
26called "dom_linker_gutenberg.js". This linker handles DOM Element objects to add
27properties to access child elements of a given element by child element tag name.
28This simplifies script access of parsed XML DOM Documents.
29
30* missing_method_linker.js
31
32This sample builds MissingMethodLinkerExporter.java and uses it in a sample script
33called "missing_method.js". This linker supports Smalltalk-style "doesNotUnderstand"
34calls on Java objects. i.e., A Java class can implement MissingMethodHandler interface
35with one method named "doesNotUnderstand". When script accesses a method on such
36object and if that method does not exist in the Java class (or any of it's supertypes),
37then "doesNotUnderstand" method is invoked.
38
39* underscore_linker.js
40
41This sample builds UnderscoreNameLinkerExporter.java and uses it in a sample script
42called "underscore.js". This linker converts underscore separated names to Camel Case
43names (as used in Java APIs). You can call Java APIs using Ruby-like naming convention
44and this linker converts method names to CamelCase!
45
46