All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.danielsomerfield.cvecheck.scratch.ScratchMain.groovy Maven / Gradle / Ivy

There is a newer version: 0.6.2-100
Show newest version
package com.danielsomerfield.cvecheck.scratch

class ScratchMain {
  public static void main(String [] args) {
    println("ScratchMain.main()")
    new ScratchMain().run()
  }

  def configure(Closure closure) {
    println(closure.dump())
    ScratchConfig config = new ScratchConfig()
    println("Pre closure: " + config.dump())
    closure.resolveStrategy = Closure.DELEGATE_FIRST
    closure.setDelegate(config)
    closure()
    println("Post closure: " + config.dump())

  }

  def run(){
    configure {
      foo {

      }
      foo {

      }
    }
  }

  public static class ScratchConfig {
    def foo(Closure closure) {
      println("ScratchConfig.foo")
    }
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy