Groovy Documentation

org.codehaus.groovy.grails.cli.support
[Java] Class ScriptBindingInitializer

java.lang.Object
  org.codehaus.groovy.grails.cli.support.ScriptBindingInitializer

public class ScriptBindingInitializer
extends java.lang.Object

Configures the binding used when running Grails scripts.

Authors:
Graeme Rocher
Since:
2.0


Constructor Summary
ScriptBindingInitializer(CommandLine commandLine, BuildSettings settings, PluginPathDiscoverySupport pluginPathSupport, boolean interactive)

 
Method Summary
org.codehaus.gant.GantBinding initBinding(org.codehaus.gant.GantBinding binding, java.lang.String scriptName)

Prep the binding.

protected boolean isDeclared(java.lang.Object cla, java.lang.reflect.Method readMethod)

protected void makeApiAvailableToScripts(org.codehaus.gant.GantBinding binding, java.lang.Object cla)

 
Methods inherited from class java.lang.Object
java.lang.Object#wait(), java.lang.Object#wait(long), java.lang.Object#wait(long, int), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll()
 

Constructor Detail

ScriptBindingInitializer

public ScriptBindingInitializer(CommandLine commandLine, BuildSettings settings, PluginPathDiscoverySupport pluginPathSupport, boolean interactive)


 
Method Detail

initBinding

@SuppressWarnings("unchecked")
public org.codehaus.gant.GantBinding initBinding(org.codehaus.gant.GantBinding binding, java.lang.String scriptName)
Prep the binding. We add the location of GRAILS_HOME under the variable name "grailsHome". We also add a closure that should be used with "includeTargets <<" - it takes a string and returns either a file containing the named Grails script or the script class. So, this: includeTargets << grailsScript("Init") will load the "Init" script from $GRAILS_HOME/scripts if it exists there; otherwise it will load the Init class.


isDeclared

protected boolean isDeclared(java.lang.Object cla, java.lang.reflect.Method readMethod)


makeApiAvailableToScripts

protected void makeApiAvailableToScripts(org.codehaus.gant.GantBinding binding, java.lang.Object cla)


 

Groovy Documentation