类 DefaultMethodReference

java.lang.Object
cn.taketoday.aot.generate.DefaultMethodReference
所有已实现的接口:
MethodReference

public class DefaultMethodReference extends Object implements MethodReference
Default MethodReference implementation based on a MethodSpec.
从以下版本开始:
4.0
作者:
Stephane Nicoll, Phillip Webb
  • 字段详细资料

    • method

      private final cn.taketoday.javapoet.MethodSpec method
    • declaringClass

      @Nullable private final cn.taketoday.javapoet.ClassName declaringClass
  • 构造器详细资料

    • DefaultMethodReference

      public DefaultMethodReference(cn.taketoday.javapoet.MethodSpec method, @Nullable cn.taketoday.javapoet.ClassName declaringClass)
  • 方法详细资料

    • toCodeBlock

      public cn.taketoday.javapoet.CodeBlock toCodeBlock()
      从接口复制的说明: MethodReference
      Return this method reference as a CodeBlock. If the reference is to an instance method then this::<method name> will be returned.
      指定者:
      toCodeBlock 在接口中 MethodReference
      返回:
      a code block for the method reference.
    • toInvokeCodeBlock

      public cn.taketoday.javapoet.CodeBlock toInvokeCodeBlock(MethodReference.ArgumentCodeGenerator argumentCodeGenerator, @Nullable cn.taketoday.javapoet.ClassName targetClassName)
      从接口复制的说明: MethodReference
      Return this method reference as a CodeBlock using the specified MethodReference.ArgumentCodeGenerator. The targetClassName defines the context in which the method invocation is added.

      If the caller has an instance of the type in which this method is defined, it can hint that by specifying the type as a target class.

      指定者:
      toInvokeCodeBlock 在接口中 MethodReference
      参数:
      argumentCodeGenerator - the argument code generator to use
      targetClassName - the target class name
      返回:
      a code block to invoke the method
    • addArguments

      protected void addArguments(cn.taketoday.javapoet.CodeBlock.Builder code, MethodReference.ArgumentCodeGenerator argumentCodeGenerator)
      Add the code for the method arguments using the specified MethodReference.ArgumentCodeGenerator if necessary.
      参数:
      code - the code builder to use to add method arguments
      argumentCodeGenerator - the code generator to use
    • instantiateDeclaringClass

      protected cn.taketoday.javapoet.CodeBlock instantiateDeclaringClass(cn.taketoday.javapoet.ClassName declaringClass)
    • isStatic

      private boolean isStatic()
    • isSameDeclaringClass

      private boolean isSameDeclaringClass(cn.taketoday.javapoet.ClassName declaringClass)
    • toString

      public String toString()
      覆盖:
      toString 在类中 Object