【发布时间】:2019-10-29 17:10:21
【问题描述】:
例如,给定这个 groovy 代码:
import java.lang.annotation.Retention
import java.lang.annotation.RetentionPolicy
import java.lang.annotation.ElementType
import java.lang.annotation.Target
@Target([ElementType.PARAMETER])
@Retention(RetentionPolicy.RUNTIME)
@interface Bar {
String qux() default ""
}
def closure1 = { @Bar(qux = 'zxv') String foo ->
println foo
}
println "[value for qux]"
如何打印 qux 的值(在本例中为 'zxv')?
【问题讨论】:
标签: groovy