javapoet 占位符

 $L 文本值

("a= b $L c $L d", "-","+")    -> a = b-c+d

("s = $L<$L", "a","b")       -> s = a

$S 字符串

("$S","hello")    -> "hello"

$T 对象

("$T.out.println()",System.class)  -> System.out.println()


$N

MethodSpec haha = MethodSpec .methodBuilder("haha").build()

("$N()",haha) -> haha()

("this.$N = $N","a","a") -> this.a = a

你可能感兴趣的:(javapoet 占位符)