22.11.11

Groovy Goodness: Create Our Own Script Class | Javalobby

Groovy Goodness: Create Our Own Script Class | Javalobby

  • By default the script is evaluated with an instance of groovy.lang.Script class.
  • But we can extends this Script class and write our DSL allowed methods, which can then be used by the DSL script. 
  • We pass our own Script class to the GroovyShell with an CompilerConfiguration object. The CompilerConfiguration allows us to set a new base script class to be used.

No comments: