
Groovy
微风好飞行
这个作者很懒,什么都没留下…
展开
-
关于 Groovy Indy 选项
关于 Groovy Indy 选项原创 2020-08-04 14:32:51 · 1014 阅读 · 5 评论 -
如何获取 Groovy 中 trait 的属性信息?
如何获取 Groovy 中 trait 的属性信息?如何给Trait 添加 Transformer?原创 2020-08-03 16:58:12 · 439 阅读 · 0 评论 -
如何在 Grails 中使用 Swagger 来编写 API 文档
答:需要自己开发一个 OAS v3 插件,已经开发了一个初步版本,有需要的请看blog。原创 2020-07-24 15:47:39 · 957 阅读 · 0 评论 -
如何从 Groovy 代码中抽取到注释?
如何从 Groovy 代码中抽取到注释?可以用 Groovy 的 AST Transformer 来读取源代码,并用正则表达式、基于规则的方式抽取 field 的注释。原创 2020-07-24 15:25:15 · 728 阅读 · 0 评论 -
如何获取Java/Groovy中 method 参数的名称?
起因最近在开发一个 Grails 的 Swagger(OpenAPI v3)插件,需要自动从action方法中生成文档,这就需要读取方法的参数名。但是在 Java 中如果编译时没有指定选项则无法获取到方法名,得到的是 argsN 这样的名字。但是 Grails 中的 data-binding 功能却能根据 action 的名称将请求参数对应到同名的参数变量上,这就说明是有办法做到的,至少在 Groovy 中是可以做到的,因此我们可以从阅读、研究 Grails 的 databinding 代码来寻找方法。当原创 2020-07-21 14:44:24 · 1121 阅读 · 0 评论 -
Groovy 编程语言的历史
Groovy 的历史原创 2020-07-17 14:08:48 · 733 阅读 · 0 评论 -
Groovy编译静态泛型方法报错的解决办法
给类添加上泛型即可正常编译原创 2020-04-12 14:53:38 · 1091 阅读 · 0 评论 -
如何将 Groovy GORM 独立地用于 Java 项目
Groovy 的 Joint Compile 产生的 GORM entity 类存根代码缺少 hasMany 属性的方法D:\git\java\gorm-for-java-standalone\src\main\groovy\Main.java:37: 错误: 找不到符号 phone.getButtons().addAll(Arrays.asList(powerButton, v...原创 2020-04-11 19:36:02 · 295 阅读 · 0 评论 -
Spock 使用问题日志
No tests found 问题环境:Gradle 6.2 + Spock-2.0-M2-groovy-3.0 + Groovy3.0.2报告错误:Execution failed for task ‘:test’.No tests found for given includes: com.telecwin.gcl.client.api.message.vo.OnlineClien...原创 2020-03-24 19:56:54 · 687 阅读 · 0 评论 -
groovy @CompileStatic + 泛型 编译出错
错误提示如下Execution failed for task ‘:compileGroovy’.BUG! exception in phase ‘instruction selection’ in source unit ‘xxxx/xxx/HttpClientRestApi.groovy’ Expected earlier checking to detect generics para...原创 2020-03-24 10:48:42 · 1335 阅读 · 0 评论 -
如何用 Groovy 做 Json串的生成(序列化)和解析(反序列化)工作
[Json格式](https://www.json.org/json-zh.html)是web开发常用的信息交换格式,规范简单,生成的内容易于理解。Groovy 中对Json的支持还是比较丰富的,下面我们就一起来看看如何使用Groovy完成常见的Json串解析(序列化)和反解(反序列化)任务。原创 2020-02-28 22:41:27 · 3216 阅读 · 1 评论