Interface LambdaFunction
- All Superinterfaces:
Maker, MethodMaker
Allows a lambda function to be defined. This interface extends
MethodMaker for
adding code to the lambda function implementation. The first parameters to the method are
the captured values, and the rest are the actual function parameters.- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddBridgeMethod(Object retType, Object... paramTypes) Adds a descriptor for a bridge method that the generated function class should define.voidaddMarkerInterface(Object markerType) Adds a marker interface that the generated function should implement.Returns the function interface type.Methods inherited from interface Maker
addAnnotation, addAttribute, classMakerModifier and TypeMethodDescriptionaddAnnotation(Object annotationType, boolean visible) Add an annotation to this item.voidaddAttribute(String name, Object value) Add a generic JVM attribute which optionally references a constant value.Returns theClassMakerfor this item, which can also be used as a type specification.Methods inherited from interface MethodMaker
abstract_, access, addExplicitInnerClass, addInnerClass, bridge, catch_, catch_, catch_, class_, concat, create, field, final_, finally_, finally_, finally_, finish, getParamTypes, getReturnType, goto_, invoke, invoke, invokeSuperConstructor, invokeThisConstructor, label, lineNum, name, native_, new_, nop, override, param, paramCount, private_, protected_, public_, receiverType, return_, return_, signature, static_, super_, super_, synchronized_, synthetic, this_, throws_, var, varargsModifier and TypeMethodDescriptionSwitch this method to be abstract.Access aVarHandlevia a pseudo field.addExplicitInnerClass(String fullName, String className) Add an inner class to this method, with an explicitly specified class name.addInnerClass(String className) Add an inner class to this method.bridge()Indicate that this method is a bridge, which implements an inherited method exactly, but it delegates to another method which returns a more specialized return type.voidConvenience method which defines an exception handler here.Define an exception handler here, which catches exceptions between the given labels.Define an exception handler here, which catches exceptions between the given labels.class_()Returns a variable of typeClasswhich represents the enclosing class of this method.Concatenate variables and constants together into a newStringin the same manner as the Java concatenation operator.create(LambdaFunction function, Object... values) Returns a variable which refers to a lambda function instance.Access a static or instance field in the enclosing object of this method.final_()Switch this method to be final.default voidDefine a finally handler which is generated for every possible exit path between the start label and here.voidDefine a finally handler which is generated for every possible exit path between the start label and here.voidDefine a finally handler which is generated for every possible exit path between the start label and here.finish()Finishes the definition of a standalone method.Type[]Returns the parameter types of this method.Returns the return type of this method.voidGenerates an unconditional goto statement to the given label, which doesn't need to be positioned yet.invoke(MethodHandle handle, Object... values) Invoke a method via aMethodHandle.Invoke a static or instance method on the enclosing object of this method.voidinvokeSuperConstructor(Object... values) Invoke asuperconstructor method on the enclosing object of this method, from within a constructor.voidinvokeThisConstructor(Object... values) Invoke athisconstructor method on the enclosing object of this method, from within a constructor.label()Returns a new label, initially unpositioned.voidlineNum(int num) Define a line number to represent the location of the next code instruction.name()Returns the name of this method.native_()Switch this method to be native.Allocate a new object.voidnop()Append an instruction which does nothing, which can be useful for debugging.override()Verifies that this method overrides an inherited virtual method.param(int index) Returns a variable which accesses a parameter of the method being built.intReturns the number of parameters which can be accessed by theparammethod.private_()Switch this method to be private.Switch this method to be protected.public_()Switch this method to be public.receiverType(Type type) Define a receiver type for the sole purpose of annotating the implicitthisparameter.voidreturn_()Generates a return void statement.voidGenerates a statement which returns a variable or a constant.Define a signature for this member, which is a string for supporting generic types.static_()Switch this method to be static.super_()Returns a variable which is used for invoking superclass methods.Returns a variable which is used for invoking inherited interface methods.Switch this method to be synchronized.Indicate that this method is synthetic.this_()Returns a variable which accesses the enclosing object of this method.Declare that this method throws the given exception type.Returns a new uninitialized variable with the given type.varargs()Indicate that this method supports a variable number of arguments.
-
Method Details
-
functionType
Type functionType()Returns the function interface type. -
addMarkerInterface
Adds a marker interface that the generated function should implement. The marker interface shouldn't have any abstract methods.- See Also:
-
addBridgeMethod
Adds a descriptor for a bridge method that the generated function class should define. A bridge method has a more specific signature than the primary function method.- Parameters:
retType- a class or name; can be null if the method returns voidparamTypes- classes or names- See Also:
-