NameDateSize

..12-Dec-2017121

array_stream.jsH A D12-Dec-20172.2 KiB

array_stream_linker.jsH A D12-Dec-20172.1 KiB

ArrayStreamLinkerExporter.javaH A D12-Dec-20175.3 KiB

buffer_index.jsH A D12-Dec-20172.4 KiB

buffer_indexing_linker.jsH A D12-Dec-20172.1 KiB

BufferIndexingLinkerExporter.javaH A D12-Dec-201711 KiB

dom_linker.jsH A D12-Dec-20172.1 KiB

dom_linker_gutenberg.jsH A D12-Dec-20173.6 KiB

DOMLinkerExporter.javaH A D12-Dec-20177.2 KiB

META-INF/H12-Dec-20173

missing_method.jsH A D12-Dec-20172.1 KiB

missing_method_linker.jsH A D12-Dec-20172.2 KiB

MissingMethodExample.javaH A D12-Dec-20172.3 KiB

MissingMethodHandler.javaH A D12-Dec-20171.8 KiB

MissingMethodLinkerExporter.javaH A D12-Dec-20178.4 KiB

READMEH A D12-Dec-20172.4 KiB

underscore.jsH A D12-Dec-20171.9 KiB

underscore_linker.jsH A D12-Dec-20172.2 KiB

UnderscoreNameLinkerExporter.javaH A D12-Dec-20174.9 KiB

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
7Note: you need to build jdk9 forest and put "images/jdk/bin" in your PATH to use
8these scripts. This is because these scripts use javac to build dynalink jar and
9exec another jjs with classpath set! Alternatively, you can also manually build
10dynalink linker jars and invoke sample scripts by putting linker jar in jjs tool's
11classpath as well.
12
13Dynalink samples:
14
15* array_stream_linker.js
16
17This sample builds ArrayStreamLinkerExporter.java and uses it in a sample script
18called "array_stream.js". This linker adds "stream" property to Java array
19objects. The "stream" property returns appropriate Stream type for the given
20Java array (IntStream, DoubleStream ...).
21
22* buffer_indexing_linker.js
23
24This sample builds BufferIndexingLinkerExporter.java and uses it in a sample script
25called "buffer_index.js". This linker adds array-like indexed access, indexed assignment
26and "length" property to Java NIO Buffer objects. Script can treat NIO Buffer objects
27as if those are just array objects.
28
29* dom_linker.js
30
31This sample builds DOMLinkerExporter.java and uses it in a sample script
32called "dom_linker_gutenberg.js". This linker handles DOM Element objects to add
33properties to access child elements of a given element by child element tag name.
34This simplifies script access of parsed XML DOM Documents.
35
36* missing_method_linker.js
37
38This sample builds MissingMethodLinkerExporter.java and uses it in a sample script
39called "missing_method.js". This linker supports Smalltalk-style "doesNotUnderstand"
40calls on Java objects. i.e., A Java class can implement MissingMethodHandler interface
41with one method named "doesNotUnderstand". When script accesses a method on such
42object and if that method does not exist in the Java class (or any of it's supertypes),
43then "doesNotUnderstand" method is invoked.
44
45* underscore_linker.js
46
47This sample builds UnderscoreNameLinkerExporter.java and uses it in a sample script
48called "underscore.js". This linker converts underscore separated names to Camel Case
49names (as used in Java APIs). You can call Java APIs using Ruby-like naming convention
50and this linker converts method names to CamelCase!
51
52