Class CoalescingWrites
- java.lang.Object
-
- org.apache.sling.scripting.sightly.impl.compiler.optimization.CoalescingWrites
-
- All Implemented Interfaces:
CommandHandler
public final class CoalescingWrites extends Object implements CommandHandler
Aggregate consecutive writes in bigger chunks of text
-
-
Field Summary
Fields Modifier and Type Field Description static StreamTransformer
TRANSFORMER
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
onDone()
This method is called when the stream has been closed.void
onEmit(Command command)
Allows this handler to process theCommand
that was just written into the stream to which this handler was attached.void
onError(String errorMessage)
Allows this handler to process error states.
-
-
-
Field Detail
-
TRANSFORMER
public static final StreamTransformer TRANSFORMER
-
-
Method Detail
-
onEmit
public void onEmit(Command command)
Description copied from interface:CommandHandler
Allows this handler to process theCommand
that was just written into the stream to which this handler was attached.- Specified by:
onEmit
in interfaceCommandHandler
- Parameters:
command
- the received command
-
onError
public void onError(String errorMessage)
Description copied from interface:CommandHandler
Allows this handler to process error states.- Specified by:
onError
in interfaceCommandHandler
- Parameters:
errorMessage
- the error's message
-
onDone
public void onDone()
Description copied from interface:CommandHandler
This method is called when the stream has been closed. The contract is that after this call, no other commands or errors will be emitted.- Specified by:
onDone
in interfaceCommandHandler
-
-