ScriptBindingInitializer (Grails 2.3.8)
Date: 2014-04-24

Overview | Package | Class | Deprecated | Index | Help
| Groovy Documentation
| FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## 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

Field Summary
`static java.lang.String` | `ARGS_MAP`
`static java.lang.String` | `BASEDIR`
`static java.lang.String` | `BASE_FILE`
`static java.lang.String` | `BASE_NAME`
`static java.lang.String` | `GRAILS_CONSOLE`
`static java.lang.String` | `GRAILS_ENV`
`static java.lang.String` | `GRAILS_HOME`
`static java.lang.String` | `GRAILS_SCRIPT`
`static java.lang.String` | `GRAILS_SETTINGS`
`static java.lang.String` | `GRAILS_VERSION`
`static java.lang.String` | `SCAFFOLD_DIR`
`static java.lang.String` | `USER_HOME`

Constructor Summary
`ScriptBindingInitializer(CommandLine commandLine, java.net.URLClassLoader classLoader, 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.
`static BaseSettingsApi` | `initBinding(groovy.lang.Binding binding, BuildSettings buildSettings, java.net.URLClassLoader classLoader, GrailsConsole grailsConsole, boolean interactive)`

Methods inherited from class java.lang.Object
java.lang.Object#wait(long, int), java.lang.Object#wait(long), java.lang.Object#wait(), 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()

Field Detail

### ARGS_MAP

    public static final java.lang.String ARGS_MAP

### BASEDIR

    public static final java.lang.String BASEDIR

### BASE_FILE

    public static final java.lang.String BASE_FILE

### BASE_NAME

    public static final java.lang.String BASE_NAME

### GRAILS_CONSOLE

    public static final java.lang.String GRAILS_CONSOLE

### GRAILS_ENV

    public static final java.lang.String GRAILS_ENV

### GRAILS_HOME

    public static final java.lang.String GRAILS_HOME

### GRAILS_SCRIPT

    public static final java.lang.String GRAILS_SCRIPT

### GRAILS_SETTINGS

    public static final java.lang.String GRAILS_SETTINGS

### GRAILS_VERSION

    public static final java.lang.String GRAILS_VERSION

### SCAFFOLD_DIR

    public static final java.lang.String SCAFFOLD_DIR

### USER_HOME

    public static final java.lang.String USER_HOME

Constructor Detail

### ScriptBindingInitializer

    public ScriptBindingInitializer(CommandLine commandLine, java.net.URLClassLoader classLoader, BuildSettings settings, PluginPathDiscoverySupport pluginPathSupport, boolean interactive)

Method Detail

### initBinding

    @java.lang.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.

### initBinding

    public static BaseSettingsApi initBinding(groovy.lang.Binding binding, BuildSettings buildSettings, java.net.URLClassLoader classLoader, GrailsConsole grailsConsole, boolean interactive)

Groovy Documentation