Class GroovyLambdaMeta

java.lang.Object
com.baomidou.mybatisplus.core.toolkit.support.GroovyLambdaMeta
All Implemented Interfaces:
LambdaMeta

public class GroovyLambdaMeta extends Object implements LambdaMeta
在 Groovy 脚本中通过 :: 创建的方法引用(MethodClosure)的元信息解析。

Groovy 将 MethodClosure 包装为 Proxy,其 InvocationHandler 提供 getDelegate() 方法可返回底层的 MethodClosure 对象,再从中通过 getMethod()(方法名)和 getOwner()(所属类/实例)解析出 Lambda 元信息。

Since:
3.5.12
Author:
miemie
  • Constructor Details

    • GroovyLambdaMeta

      public GroovyLambdaMeta(Proxy func)
  • Method Details

    • getImplMethodName

      public String getImplMethodName()
      Description copied from interface: LambdaMeta
      获取 lambda 表达式实现方法的名称
      Specified by:
      getImplMethodName in interface LambdaMeta
      Returns:
      lambda 表达式对应的实现方法名称
    • getInstantiatedClass

      public Class<?> getInstantiatedClass()
      Description copied from interface: LambdaMeta
      实例化该方法的类
      Specified by:
      getInstantiatedClass in interface LambdaMeta
      Returns:
      返回对应的类名称
    • toString

      public String toString()
      Overrides:
      toString in class Object