Skip to content
Browse files

full qualified JsonConverter for use in other packages

  • Loading branch information...
1 parent 51f2d9f commit b422073a31a07338019a526a414bd638d6672c71 @twest72 committed
Showing with 5 additions and 8 deletions.
  1. +5 −8 src/main/groovy/de/aonnet/json/JsonSupportTransformation.groovy
View
13 src/main/groovy/de/aonnet/json/JsonSupportTransformation.groovy
@@ -76,26 +76,23 @@ class JsonSupportTransformation implements ASTTransformation {
class ${classNode.nameWithoutPackage} {
String toJsonString() {
- return JsonConverter.toJsonString(this)
+ return de.aonnet.json.JsonConverter.toJsonString(this)
}
Map toJsonMap() {
- return JsonConverter.toJsonMap(this)
+ return de.aonnet.json.JsonConverter.toJsonMap(this)
}
static def newInstanceFromJsonString(String json) {
- return JsonConverter.newInstanceFromJsonString(json)
+ return de.aonnet.json.JsonConverter.newInstanceFromJsonString(json)
}
static def newInstanceFromJsonMap(Map map) {
- return JsonConverter.newInstanceFromJsonMap(map)
+ return de.aonnet.json.JsonConverter.newInstanceFromJsonMap(map)
}
}
""")
- classNode.addMethod(ast[1].methods[0])
- classNode.addMethod(ast[1].methods[1])
- classNode.addMethod(ast[1].methods[2])
- classNode.addMethod(ast[1].methods[3])
+ ast[1].methods.each { classNode.addMethod(it) }
}
}

0 comments on commit b422073

Please sign in to comment.
Something went wrong with that request. Please try again.