Class GrouperGroovysh

java.lang.Object
org.codehaus.groovy.tools.shell.Shell
org.codehaus.groovy.tools.shell.Groovysh
edu.internet2.middleware.grouper.app.gsh.GrouperGroovysh
All Implemented Interfaces:
groovy.lang.GroovyObject

public class GrouperGroovysh extends org.codehaus.groovy.tools.shell.Groovysh
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
     

    Nested classes/interfaces inherited from class org.codehaus.groovy.tools.shell.Groovysh

    org.codehaus.groovy.tools.shell.Groovysh._closure1, org.codehaus.groovy.tools.shell.Groovysh._closure2
  • Field Summary

    Fields inherited from class org.codehaus.groovy.tools.shell.Groovysh

    AUTOINDENT_PREFERENCE_KEY, COLLECTED_BOUND_VARS_MAP_VARNAME, COLORS_PREFERENCE_KEY, INTERPRETER_MODE_PREFERENCE_KEY, METACLASS_COMPLETION_PREFIX_LENGTH_PREFERENCE_KEY, SANITIZE_PREFERENCE_KEY, SHOW_LAST_RESULT_PREFERENCE_KEY

    Fields inherited from class org.codehaus.groovy.tools.shell.Shell

    log
  • Constructor Summary

    Constructors
    Constructor
    Description
    GrouperGroovysh(org.codehaus.groovy.tools.shell.IO io, org.codehaus.groovy.control.CompilerConfiguration compilerConfiguration, boolean exitOnError)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    addImports(org.codehaus.groovy.control.CompilerConfiguration compilerConfiguration)
    dont call this, too much of a performance penalty
    protected void
     
    static int
    how many lines are in the lightweight profile
    static int
    how many lines are in the normal profile
     
    static Throwable
    handleGshException(boolean isLightWeight, int scriptPrependHeaders, String scriptString, Throwable scriptException)
     
    static void
    runScript(GrouperGroovyInput grouperGroovyInput, GrouperGroovysh.GrouperGroovyResult grouperGroovyResult)
    run a script and return the result.
    runScript(String script)
    run a script and return the result.
    runScript(String script, boolean lightWeight)
    run a script and return the result.
    runScript(String script, boolean lightWeight, boolean sendErrToOut)
    Deprecated.
    since sendErrToOut doesnt make sense
    static boolean
    scriptLineExit(int lineNumber, String it)
    if running through a script, need to exit script
    static boolean
    scriptLineIgnore(int lineNumber, String it)
    if running through a script, need to ignore line
    see if there's a grouper session running; return if it's there otherwise start root session and return that.

    Methods inherited from class org.codehaus.groovy.tools.shell.Groovysh

    displayBuffer, displayWelcomeBanner, execute, executeCommand, formatLineNumber, getBuffers, getDefaultErrorHook, getDefaultResultHook, getErrorHook, getEvictedLine, getHistory, getHistoryFull, getImports, getImportStatements, getIndentPrefix, getIndentSize, getInterp, getPackageHelper, getParser, getPreference, getResultHook, getRunner, getUserStateDirectory, isHistoryFull, isTypeOrMethodDeclaration, loadUserScript, maybeRecordError, maybeRecordInput, maybeRecordResult, renderPrompt, run, run, setErrorHook, setEvictedLine, setHistory, setHistoryFull, setIndentSize, setPackageHelper, setResultHook, setRunner

    Methods inherited from class org.codehaus.groovy.tools.shell.Shell

    findCommand, findCommand, getIo, getRegistry, isExecutable, leftShift, leftShift, register

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface groovy.lang.GroovyObject

    getMetaClass, getProperty, invokeMethod, setMetaClass, setProperty
  • Constructor Details

    • GrouperGroovysh

      public GrouperGroovysh(org.codehaus.groovy.tools.shell.IO io, org.codehaus.groovy.control.CompilerConfiguration compilerConfiguration, boolean exitOnError)
      Parameters:
      io -
      compilerConfiguration -
      exitOnError -
  • Method Details

    • scriptLineExit

      public static boolean scriptLineExit(int lineNumber, String it)
      if running through a script, need to exit script
      Parameters:
      lineNumber -
      line -
      Returns:
      true if exit script
    • scriptLineIgnore

      public static boolean scriptLineIgnore(int lineNumber, String it)
      if running through a script, need to ignore line
      Parameters:
      lineNumber -
      line -
      Returns:
      true if skip line
    • runScript

      public static GrouperGroovysh.GrouperGroovyResult runScript(String script)
      run a script and return the result. Note, check for exception and rethrow. Note this uses
      Parameters:
      script -
      Returns:
      the result
    • runScript

      public static GrouperGroovysh.GrouperGroovyResult runScript(String script, boolean lightWeight)
      run a script and return the result. Note, check for exception and rethrow. Note this uses
      Parameters:
      script -
      lightWeight - will use an abbreviated groovysh.profile for faster speed. built in commands arent there and imports largely arent there
      Returns:
      the result
    • runScript

      public static GrouperGroovysh.GrouperGroovyResult runScript(String script, boolean lightWeight, boolean sendErrToOut)
      Deprecated.
      since sendErrToOut doesnt make sense
      run a script and return the result. Note, check for exception and rethrow. Note this uses
      Parameters:
      script -
      lightWeight - will use an abbreviated groovysh.profile for faster speed. built in commands arent there and imports largely arent there
      Returns:
      the result
    • getLightWeightLines

      public static int getLightWeightLines()
      how many lines are in the lightweight profile
      Returns:
    • getNormalLines

      public static int getNormalLines()
      how many lines are in the normal profile
      Returns:
    • runScript

      public static void runScript(GrouperGroovyInput grouperGroovyInput, GrouperGroovysh.GrouperGroovyResult grouperGroovyResult)
      run a script and return the result. Note, check for exception and rethrow. Note this uses
      Parameters:
      script -
      lightWeight - will use an abbreviated groovysh.profile for faster speed. built in commands arent there and imports largely arent there
    • addImports

      public static void addImports(org.codehaus.groovy.control.CompilerConfiguration compilerConfiguration)
      dont call this, too much of a performance penalty
    • getThrowable

      public Throwable getThrowable()
      Returns:
      the throwable
    • displayError

      protected void displayError(Throwable cause)
    • startRootSessionIfNoSessionRunning

      public static GrouperSession startRootSessionIfNoSessionRunning()
      see if there's a grouper session running; return if it's there otherwise start root session and return that.
      Returns:
    • handleGshException

      public static Throwable handleGshException(boolean isLightWeight, int scriptPrependHeaders, String scriptString, Throwable scriptException)