Search in sources :

Example 1 with VarData

use of com.guigarage.shell.event.VarData in project jdk9-jigsaw by AdoptOpenJDK.

the class ShellService method eval.

public synchronized void eval(String command) {
    List<SnippetEvent> events = shell.eval(command);
    for (SnippetEvent event : events) {
        if (event.snippet() instanceof VarSnippet) {
            String type = ((VarSnippet) event.snippet()).typeName();
            String name = ((VarSnippet) event.snippet()).name();
            String value = event.value();
            VarData varData = new VarData(type, name, value);
            eventBus.publish(Topics.VAR_CREATED_TOPIC, varData);
            variables.add(varData);
        }
    }
}
Also used : VarSnippet(jdk.jshell.VarSnippet) SnippetEvent(jdk.jshell.SnippetEvent) VarData(com.guigarage.shell.event.VarData)

Aggregations

VarData (com.guigarage.shell.event.VarData)1 SnippetEvent (jdk.jshell.SnippetEvent)1 VarSnippet (jdk.jshell.VarSnippet)1