info.magnolia.module.groovy.console
Class MgnlGroovyConsole

java.lang.Object
  extended by groovy.lang.GroovyObjectSupport
      extended by groovy.lang.GroovyShell
          extended by info.magnolia.module.groovy.console.MgnlGroovyConsole
All Implemented Interfaces:
groovy.lang.GroovyObject

public class MgnlGroovyConsole
extends groovy.lang.GroovyShell

Groovy console using MgnlGroovyClassLoader to parse Groovy source.

Version:
$Id$
Author:
fgrilli

Field Summary
 
Fields inherited from class groovy.lang.GroovyShell
DEFAULT_CODE_BASE, EMPTY_ARGS
 
Constructor Summary
MgnlGroovyConsole(groovy.lang.Binding binding)
           
 
Method Summary
 Object evaluate(InputStream in, String fileName, Writer out)
           
 String generateScriptName()
           
 groovy.lang.Script parse(groovy.lang.GroovyCodeSource codeSource)
          Parses the given script and returns it ready to be run.
 
Methods inherited from class groovy.lang.GroovyShell
evaluate, evaluate, evaluate, evaluate, evaluate, evaluate, evaluate, evaluate, evaluate, getClassLoader, getContext, getProperty, getVariable, initializeBinding, main, parse, parse, parse, parse, parse, parse, parse, resetLoadedClasses, run, run, run, run, run, run, setProperty, setVariable
 
Methods inherited from class groovy.lang.GroovyObjectSupport
getMetaClass, invokeMethod, setMetaClass
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MgnlGroovyConsole

public MgnlGroovyConsole(groovy.lang.Binding binding)
Method Detail

evaluate

public Object evaluate(InputStream in,
                       String fileName,
                       Writer out)
                throws org.codehaus.groovy.control.CompilationFailedException
Throws:
org.codehaus.groovy.control.CompilationFailedException

parse

public groovy.lang.Script parse(groovy.lang.GroovyCodeSource codeSource)
                         throws org.codehaus.groovy.control.CompilationFailedException
Parses the given script and returns it ready to be run. When running in a secure environment (-Djava.security.manager) codeSource.getCodeSource() determines what policy grants should be given to the script.

Overrides:
parse in class groovy.lang.GroovyShell
Parameters:
codeSource -
Returns:
ready to run script
Throws:
org.codehaus.groovy.control.CompilationFailedException

generateScriptName

public String generateScriptName()
Overrides:
generateScriptName in class groovy.lang.GroovyShell


Copyright © 2013 Magnolia International Ltd.. All Rights Reserved.