Top Description Fields Constructors Methods
com.headius.invokebinder.transform

public Class TryFinally

extends Transform
Class Inheritance
Imports
com.headius.invokebinder.Binder, .Util, java.lang.invoke.MethodHandle, .MethodHandles, .MethodType, java.lang.reflect.InvocationTargetException

An try-finally transform. Equivalent call: A combination of folds and catches. MethodHandle exceptionHandler = [drop exception and invoke post logic] target = MethodHandles.catchException(target, Throwable.class, exceptionHandler) target = MethodHandles.foldArguments(post, target)

Field Summary

Modifier and TypeField and Description
private final MethodHandle
private static final MethodHandle

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public MethodType
down(MethodType
the source type
type
)

Implements abstract com.headius.invokebinder.transform.Transform.down.

Apply this transform downward from an incoming MethodType, producing a new type.
private MethodHandle
public String
toJava(MethodType incoming)

Implements abstract com.headius.invokebinder.transform.Transform.toJava.

Return a Java code representation of this transform.
public String
toString()

Implements abstract com.headius.invokebinder.transform.Transform.toString.

Return a string representation of this transform.
public MethodHandle
up(MethodHandle
the target handle
target
)

Implements abstract com.headius.invokebinder.transform.Transform.up.

Apply this transform upward from the given MethodHandle, producing a new handle.
Inherited from com.headius.invokebinder.transform.Transform:
buildClassArgumentbuildClassArgumentsbuildClassCastbuildPrimitiveJavagenerateMethodType

Field Detail

postback to summary
private final MethodHandle post
tryFinallyJava9back to summary
private static final MethodHandle tryFinallyJava9

Constructor Detail

TryFinallyback to summary
public TryFinally(MethodHandle post)

Method Detail

downback to summary
public MethodType down(MethodType type)

Implements abstract com.headius.invokebinder.transform.Transform.down.

Doc from com.headius.invokebinder.transform.Transform.down.

Apply this transform downward from an incoming MethodType, producing a new type.

Parameters
type:MethodType

the source type

Returns:MethodType

the new type

nativeTryFinallyback to summary
private MethodHandle nativeTryFinally(MethodHandle target, MethodHandle post)
toJavaback to summary
public String toJava(MethodType incoming)

Implements abstract com.headius.invokebinder.transform.Transform.toJava.

Doc from com.headius.invokebinder.transform.Transform.toJava.

Return a Java code representation of this transform.

Returns:String

a Java code representation of this transform.

toStringback to summary
public String toString()

Implements abstract com.headius.invokebinder.transform.Transform.toString.

Doc from com.headius.invokebinder.transform.Transform.toString.

Return a string representation of this transform.

Returns:String

a string representation of this transform

upback to summary
public MethodHandle up(MethodHandle target)

Implements abstract com.headius.invokebinder.transform.Transform.up.

Doc from com.headius.invokebinder.transform.Transform.up.

Apply this transform upward from the given MethodHandle, producing a new handle.

Parameters
target:MethodHandle

the target handle

Returns:MethodHandle

the adapted handle