Don't like ads? PRO users don't see any ads ;-)
Guest

MixinsGroovy

By: a guest on Jan 14th, 2012  |  syntax: Groovy  |  size: 0.15 KB  |  hits: 107  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. @Category(Object) class M1 { def x() { "m1" } }
  2. @Category(Object) class M2 { def x() { "m2" } }
  3.  
  4.  
  5. @Mixin([M1, M2]) class C {}
  6. new C().x() //===> m2