org.fiolino.common.reflection.MethodVisitor Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of commons Show documentation
Show all versions of commons Show documentation
General structure to easily create dynamic logic via MethodHandles and others.
package org.fiolino.common.reflection;
import java.lang.invoke.MethodHandle;
import java.lang.reflect.Method;
import java.util.function.Supplier;
/**
* Created by Kuli on 6/15/2016.
*/
public interface MethodVisitor {
/**
* Is called as a callback from a method visitor.
*
* @param value The value from the previous run (or the initial value, if it's the first run)
* @param m The visited method
* @param handleSupplier Will return the MethodHandle of that method, or the created handle by that
* @return The value for the next run, or the return value in case of the last run
*/
V visit(V value, Method m, Supplier handleSupplier);
}