(ConsoleOperation output)
| 87 | console.setPrompt(new Prompt(prompt)); |
| 88 | console.setConsoleCallback(new AeshConsoleCallback() { |
| 89 | @Override |
| 90 | public int execute(ConsoleOperation output) { |
| 91 | String statement = output.getBuffer(); |
| 92 | log.write(statement + "\n"); |
| 93 | if (statement.equalsIgnoreCase("exit")) { |
| 94 | console.stop(); |
| 95 | return 0; |
| 96 | } else { |
| 97 | try { |
| 98 | Object object = runtime.evaluate(statement); |
| 99 | log.write(object.toString() + "\n"); |
| 100 | console.getShell().out().println(object.toString()); |
| 101 | } catch (DynJSException e) { |
| 102 | console.getShell().out().println(e.getLocalizedMessage()); |
| 103 | logException(e); |
| 104 | } catch (IncompatibleClassChangeError e) { |
| 105 | console.getShell().err().println("ERROR> " + e.getLocalizedMessage()); |
| 106 | console.getShell().err().println("Error parsing statement: " + statement); |
| 107 | logException(e); |
| 108 | } catch (Exception e) { |
| 109 | e.printStackTrace(new PrintWriter(out)); |
| 110 | logException(e); |
| 111 | } |
| 112 | } |
| 113 | return 0; |
| 114 | } |
| 115 | }); |
| 116 | console.start(); |
| 117 | } |
nothing calls this directly
no test coverage detected