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 (args['file'].extension == 'gant') {
    addProperty "ant", "org.codehaus.gant.GantBuilder"
    //...
    addMethod "depends", ["java.util.List", "list"], "void"
  }
}

enhance { Map args ->
  if (args['class'].hasAnnotation("foo.Precious")) {
    mix "foo.MyPreciousClass"
  }
}

enhance { Map args ->
  def cls = args['class']
  if (isDomain(cls)) {
    if (args['referenceName']) {
      resolveDynamicFinder(args['referenceName'])
    } else if (args['completionPrefix']) {
      generateNextFinderNames(args['completionPrefix']).each {
        addPartialMethodaddMethod it, [], cls.qualifiedName, partial:true
      }
    }
  }
}

enhance "groovy.lang.Script" { Map args ->
  if (args['file'].extension == 'gdsl') {
    addMethod "enhance", ["java.lang.String", "className", "groovy.lang.Closure", "enhancer"], "void"
  }
}