public abstract class BinderClosureScript
extends groovy.lang.Script
Script that provides DSL for Guice binder.
Named values can be done as an assignment.
foo = 5
| Constructor and Description |
|---|
BinderClosureScript() |
BinderClosureScript(groovy.lang.Binding binding) |
| Modifier and Type | Method and Description |
|---|---|
com.google.inject.Binder |
getBinder()
Expose
Binder to the script. |
Map<String,String> |
getEnvs()
Convenient access to environment variables.
|
Map<String,String> |
getProperties()
Convenient access to system properties.
|
Object |
getProperty(String property) |
Object |
invokeMethod(String name,
Object args) |
com.google.inject.Module |
module(groovy.lang.Closure c)
Given a closure that uses Groovy binder DSL, wrap that into a Guice
Module. |
void |
setBinder(com.google.inject.Binder binder)
Sets the delegation target.
|
void |
setProperty(String property,
Object value)
Convenience method to bind simple properties
|
public BinderClosureScript()
public BinderClosureScript(groovy.lang.Binding binding)
public void setProperty(String property, Object value)
setProperty in interface groovy.lang.GroovyObjectsetProperty in class groovy.lang.Scriptpublic void setBinder(com.google.inject.Binder binder)
public Object invokeMethod(String name, Object args)
invokeMethod in interface groovy.lang.GroovyObjectinvokeMethod in class groovy.lang.Scriptpublic Object getProperty(String property)
getProperty in interface groovy.lang.GroovyObjectgetProperty in class groovy.lang.Scriptpublic com.google.inject.Binder getBinder()
Binder to the script.public com.google.inject.Module module(groovy.lang.Closure c)
Module.
To reuse the DSL methods defined on BinderClosureScript and its super types,
while we call the closure we temporarily swap Binder object.
Copyright © 2004-2014. All Rights Reserved.