F - type of the lambda represented by this LambdaExpression.public final class LambdaExpression<F> extends InvocableExpression
Use parse(Object) method to get a lambda expression tree.
| Modifier and Type | Method and Description |
|---|---|
Function<Object[],?> |
compile()
Produces a
Function that represents the lambda expression. |
static Function<Object[],?> |
compile(Expression e)
Produces a
Function that represents the expression. |
boolean |
isMethodRef()
Gets a value indicating whether the lambda expression tree node represents a lambda expression calling a
method.
|
static <T> LambdaExpression<T> |
parse(T lambda)
Creates
LambdaExpression representing the lambda expression tree. |
static LambdaExpression<?> |
parseMethod(Method method,
Object instance)
Creates
LambdaExpression representing the passed method expression tree. |
static <T> LambdaExpression<T> |
parseMethod(T methodReference)
Creates
LambdaExpression representing the passed method expression tree. |
LambdaExpression<F> |
parseMethodRef()
If the LambdaExpression wraps a method call, then returns the method representation as an AST.
Otherwise, returns the current lambda expression. The result is always semantically equivalent to the current lambda expression. |
String |
toString() |
protected <T> T |
visit(ExpressionVisitor<T> v)
Dispatches to the specific visit method for this node type.
|
accept, add, arrayIndex, arrayLength, binary, binary, bitwiseAnd, bitwiseNot, bitwiseOr, block, coalesce, condition, constant, constant, convert, delegate, divide, equal, equals, exclusiveOr, get, get, get, greaterThan, greaterThanOrEqual, instanceOf, instanceOf, invoke, invoke, invoke, invoke, invoke, invoke, isNonNull, isNull, lambda, leftShift, lessThan, lessThanOrEqual, logicalAnd, logicalNot, logicalOr, member, modulo, multiply, negate, newArrayInit, newInstance, newInstance, newInstance, notEqual, parameter, rightShift, subtract, unarypublic boolean isMethodRef()
public LambdaExpression<F> parseMethodRef()
public static <T> LambdaExpression<T> parse(T lambda)
LambdaExpression representing the lambda expression tree.T - the type of lambda to parselambda - - the lambdaLambdaExpression representing the lambda expression tree.public static <T> LambdaExpression<T> parseMethod(T methodReference)
LambdaExpression representing the passed method expression tree.T - the type of lambda to parsemethodReference - - reference to a method, e.g. MyClass::doWorkLambdaExpression representing the lambda expression tree.public static LambdaExpression<?> parseMethod(Method method, Object instance)
LambdaExpression representing the passed method expression tree.method - to parseinstance - Required if the method is not static, otherwise null.LambdaExpression representing the lambda expression tree.public static Function<Object[],?> compile(Expression e)
Function that represents the expression.e - Expression to compileFunction that represents the expression.public Function<Object[],?> compile()
Function that represents the lambda expression.Function that represents the lambda expression.protected <T> T visit(ExpressionVisitor<T> v)
ExpressionBinaryExpression calls the
ExpressionVisitor.visit(BinaryExpression).visit in class ExpressionT - type the visitor methods return after processing.v - The visitor to visit this node with.Copyright © 2023 Streamx. All rights reserved.