Как мне получить что-то вроде анонимного внутреннего класса в Groovy?

Как мне определить анонимный внутренний класс в Groovy? Я видел ссылки, которые должны были поддерживаться в Groovy 1.7, и я использую 1.8.

 thread = process.consumeProcessOutput(
   new Appendable() {
     Appendable append(char c) {
       app1.append(c)
       app2.append(c)
       return this
     }

     Appendable append(CharSequence csq) {
       app1.append(csq)
       app2.append(csq)
       return this
     }

     Appendable append(CharSequence csq, int start, int end) {
       app1.append(csq, start, end)
       app2.append(csq, start, end)
       return this
     }
   })

I) получить исключение с этим кодом:

Caught: groovy.lang.MissingMethodException: No signature of method: java.lang.UNIXProcess.consumeProcessOutput() is applicable for argument types: (MyClass$1) values: [MyClass$1@19c8ef56]
7
задан dromodel 25 October 2011 в 20:36
поделиться