( String source, int lineNo, int columnNo, Object expr)
| 175 | } |
| 176 | |
| 177 | public Object eval ( |
| 178 | String source, int lineNo, int columnNo, Object expr) |
| 179 | throws BSFException |
| 180 | { |
| 181 | if ( ! (expr instanceof String) ) |
| 182 | throw new BSFException("BeanShell expression must be a string"); |
| 183 | |
| 184 | try { |
| 185 | return interpreter.eval( ((String)expr) ); |
| 186 | } catch ( InterpreterError e ) |
| 187 | { |
| 188 | throw new BSFException( |
| 189 | "BeanShell interpreter internal error: "+e |
| 190 | + sourceInfo(source,lineNo,columnNo) ); |
| 191 | } catch ( TargetError e2 ) |
| 192 | { |
| 193 | throw new BSFException( |
| 194 | "The application script threw an exception: " |
| 195 | + e2.getTarget() |
| 196 | + sourceInfo(source,lineNo,columnNo) ); |
| 197 | } catch ( EvalError e3 ) |
| 198 | { |
| 199 | throw new BSFException( |
| 200 | "BeanShell script error: "+e3 |
| 201 | + sourceInfo(source,lineNo,columnNo) ); |
| 202 | } |
| 203 | } |
| 204 | |
| 205 | |
| 206 | public void exec (String source, int lineNo, int columnNo, Object script) |
no test coverage detected