private static String getScriptName ( ScriptContext context ) { if ( context == null ) { throw new IllegalArgumentException ( "Invalid context - must be non null" ) ; } Object scriptName = context . getAttribute ( ExtensionScript . SCRIPT_NAME_ATT ) ; if ( scriptName == null ) { throw new IllegalArgumentException ( "Failed to find script name in the script context." ) ; } if ( ! ( scriptName instanceof String ) ) { throw new IllegalArgumentException ( "The script name is not a String: " + scriptName . getClass ( ) . getCanonicalName ( ) ) ; } return ( String ) scriptName ; }
Gets the script name from the given context .