public ScriptSingleValueMethodCall( final Interpreter interpreter, final BshMethod method, final String scriptFileName, int numParameters) { super(scriptFileName, method.getName(), false, numParameters); this.interpreter = interpreter; this.method = method; if (this.interpreter == null) { throw new NullPointerException("Interpreter is null."); } else if (!String.class.isAssignableFrom(this.method.getReturnType())) { throw new IllegalArgumentException( "The method's return type has to be assignable to String:\nScript: " + scriptFileName + "\nMethod: " + method.toString()); } }