Interface CommandStream

  • @ProviderType
    public interface CommandStream

    This interface defines a stream to which Commands are pushed during the compilation of a HTL script by the SightlyCompiler. Depending on how a consumer wants to use the stream there are several options:

    • if the stream needs to be consumed immediately then a CommandHandler can be attached to the stream; the stream, in turn, will notify the handler for every command that has been pushed;
    • if the stream can be consumed after the actual compilation there's no need to attach a CommandHandler, as the Commands that were written to the stream can be replayed in the exact order in which they have been pushed.
    • Method Detail

      • addHandler

        void addHandler​(CommandHandler handler)
        Registers a listening CommandHandler to the stream. The CommandHandler will be notified for every new Command pushed to this stream.
        handler - the handler to attach to this stream
      • getCommands

        java.util.List<Command> getCommands()
        Returns the List of commands that were written into this stream.
        the commands written into this stream