Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

For this example there's a magic Whatsit module, which is unspecified in 1.0 - which extends String to add a new addWibble() method

Code Block
import bar.*
use Cheese      // same as use bar.Cheese
use foo.bar.Whatsit

def foo = "hello"
foo.addWibble()
Code Block
import foo.bar.*

class Cheese {
    def foo() {
        use (Whatsit) {
            String x = "hey"
            x.addWibble()
        }
    }
}
Code Block
module spring.Enhancements

public aspect MyEnhancement enhances List {
  def addWibble()
}
----
package spring.enhancements

module Cheese extends Foo {
  public aspect MyEnhancement enhances List {
    def addWibble()
  }
}

use spring.enhancement
...

class Foo uses Cheese.MyEnhancement {
}

use spring.enhancements.MyEnhancement
...

class Foo uses MyEnhancement {
}

---
import java.util.List uses spring.enhancements.*, MyEnhancement,BlackdragsWeirdStuff
def l=[]
l.addWibble()
Code Block
module 
import java.util.List uses Cheese.MyEnhancement