Class PushStream
java.lang.Object
org.apache.sling.scripting.sightly.impl.compiler.PushStream
- All Implemented Interfaces:
CommandStream
A stream that can be written into.
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddHandler(CommandHandler handler) Registers a listeningCommandHandlerto the stream.voidclose()Closes this stream.Returns theListof commands that were written into this stream.voidsignalError(String message) Signal an error to the attachedCommandHandler.voidwarn(PushStream.StreamMessage warning) void
-
Constructor Details
-
PushStream
public PushStream()
-
-
Method Details
-
addHandler
Description copied from interface:CommandStreamRegisters a listeningCommandHandlerto the stream. TheCommandHandlerwill be notified for every newCommandpushed to this stream.- Specified by:
addHandlerin interfaceCommandStream- Parameters:
handler- the handler to attach to this stream
-
getCommands
Description copied from interface:CommandStreamReturns theListof commands that were written into this stream.- Specified by:
getCommandsin interfaceCommandStream- Returns:
- the commands written into this stream
-
getWarnings
-
write
-
signalError
Signal an error to the attachedCommandHandler.- Parameters:
message- the error message- Throws:
UnsupportedOperationException- if the stream has been closed
-
close
public void close()Closes this stream. Once the stream has been closed no other methods can be called on the stream any more.- Throws:
UnsupportedOperationException- if the stream has already been closed
-
warn
-