I already have defined a DSL in Groovy. Now I'm working on the Eclipse integration so that I have auto completion and other fancy stuff.

This doesn't work:

method name:"myMethod", params : [param1: MyClass]

This works:

method name:"myMethod", params : [param1: java.util.Random] 

How can I use MyClass as a type for one of my parameters?

MyClass is a Groovy class in the normal package tree. I have tried it with another classes and interfaces which are defined in the DSDL itself. Then it works.

有帮助吗?

解决方案

I believe you need to put the fully qualified class name as a String as shown a page or so down from here

So:

method name:"myMethod", params : [param1: MyClass]

Should be:

method name:"myMethod", params : [param1: "my.package.MyClass"]
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top