Child pages
  • Scripting IDE for DSL awareness

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block

enhance "java.lang.String" {
  mix "foo.StringUtils"
}

enhance "groovy.lang.Script" {
Map args ->
  if (file.extension == 'gant') {
    property "ant", "org.codehaus.gant.GantBuilder"
    //...
    method name:"depends", type:"void", params:[list:"List"]
  }
}

enhance {
Map args ->
  if (clazz.hasAnnotation("foo.Precious")) {
    mix "foo.MyPreciousClass"
  }
}

enhance { 
  if (isDomain(clazz)) {
    if (referenceName) {
      (name, params) = resolveDynamicFinder(referenceName)
      method name:it, type:clazz.qualifiedName, params:params
    } else {
      if (completionPrefix) {
        generateNextFinderNames(completionPrefix).each { name, params ->
          method name:name, type:clazz.qualifiedName, partial:true, static:true, params:params
        }
      }
    }
  }
}

enhance "groovy.lang.Script" { 
  if (file.extension == 'gdsl') {
    method name:"enhance", type:"void", params:[className:"String", enhancer:{
      property "clazz", "ClassWrapper"
      method name:"method", type:"void", params:[name:"String", type:"String", partial:"boolean", params:"Map"]
    }]
  }
}

class DGM {
  each(List, Closure c)
}