File: README.markdown

package info (click to toggle)
invokebinder 1.7-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 420 kB
  • ctags: 585
  • sloc: java: 3,036; xml: 172; makefile: 4
file content (29 lines) | stat: -rw-r--r-- 1,026 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
Introduction
============

This library hopes to provide a more friendly DSL for binding method handles.
Unlike the normal MethodHandle API, handles are bound forward from a source
MethodType and eventually adapted to a final target MethodHandle. Along the way
the transformations are pushed onto a stack and eventually applied in reverse
order, as the standard API demands.

Examples
========

Transformation calls can be chained. They are not applied until an eventual
"invoke" is called with the target endpoint MethodHandle.

    MethodHandle mh = Binder
       .from(String.class, String.class, String.class) // String w(String, String)
       .drop(1, String.class) // String x(String)
       .insert(0, 'hello') // String y(String, String)
       .cast(String.class, CharSequence.class, Object.class) // String z(CharSequence, Object)
       .invoke(someTargetHandle);

Status
======

This is currently under development. Not all transformations from the MethodHandle
API are yet supported.

Contributors are welcome :)