public Map<String, Object> getAttributes() { return commandContext.getAttributes(); } }
public Class<P> getConsumedType() { return commandContext.getConsumedType(); }
public Map<String, Object> getSession() { return commandContext.getSession(); }
public int getHeight() { return commandContext.getHeight(); }
public int getWidth() { return commandContext.getWidth(); }
public void close() throws Exception { if (status != CLOSED) { try { flush(); } catch (Exception e) { // Ignore ? } status = CLOSED; commandContext.close(); } }
public void provide(P element) throws Exception { if (status != CLOSED) { status = WRITTEN; commandContext.provide(element); } }
public void flush() throws IOException { if (status == WRITTEN) { status = FLUSHED; commandContext.flush(); } }
public String readLine(String msg, boolean echo) throws IOException, InterruptedException { return commandContext.readLine(msg, echo); }
public String getProperty(String propertyName) { return consumer.getProperty(propertyName); }
public InvocationContextImpl<P> leftShift(Object o) throws IOException { if (commandContext.getConsumedType().isInstance(o)) { P p = commandContext.getConsumedType().cast(o); commandContext.provide(p); } return this; } }
public Map<String, Object> getSession() { return consumer.getSession(); }
public int getHeight() { return screenContext != null ? screenContext.getHeight() : consumer.getHeight(); }
public int getWidth() { return screenContext != null ? screenContext.getWidth() : consumer.getWidth(); }
public void close() throws IOException, CommandException { try { current.close(); } catch (Exception e) { throw new CommandException(ErrorKind.EVALUATION, e); } } }
public void provide(Object element) throws IOException, CommandException { if (type.isInstance(element)) { Object ret = closure.call(element); if (ret != null) { try { consumer.provide(ret); } catch (Exception e) { throw new CommandException(ErrorKind.EVALUATION, e); } } } }
public void flush() throws IOException { consumer.flush(); }
public String readLine(String msg, boolean echo) throws IOException, InterruptedException { return consumer.readLine(msg, echo); }
public String getProperty(String propertyName) { return commandContext.getProperty(propertyName); }