invokebinder

Sonatype helps open source projects to set up Maven repositories on https://oss.sonatype.org/

License

License

GroupId

GroupId

com.headius
ArtifactId

ArtifactId

invokebinder
Last Version

Last Version

1.12
Release Date

Release Date

Type

Type

jar
Description

Description

invokebinder
Sonatype helps open source projects to set up Maven repositories on https://oss.sonatype.org/
Project URL

Project URL

http://maven.apache.org
Source Code Management

Source Code Management

https://github.com/headius/invokebinder

Download invokebinder

How to add to project

<!-- https://jarcasting.com/artifacts/com.headius/invokebinder/ -->
<dependency>
    <groupId>com.headius</groupId>
    <artifactId>invokebinder</artifactId>
    <version>1.12</version>
</dependency>
// https://jarcasting.com/artifacts/com.headius/invokebinder/
implementation 'com.headius:invokebinder:1.12'
// https://jarcasting.com/artifacts/com.headius/invokebinder/
implementation ("com.headius:invokebinder:1.12")
'com.headius:invokebinder:jar:1.12'
<dependency org="com.headius" name="invokebinder" rev="1.12">
  <artifact name="invokebinder" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.headius', module='invokebinder', version='1.12')
)
libraryDependencies += "com.headius" % "invokebinder" % "1.12"
[com.headius/invokebinder "1.12"]

Dependencies

test (1)

Group / Artifact Type Version
junit : junit jar 4.13.1

Project Modules

There are no modules declared in this project.

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 :)

Versions

Version
1.12
1.11
1.10
1.9
1.8
1.7
1.6
1.5
1.4
1.3
1.2
1.1
1.0