Class ProcessorPipeline
- java.lang.Object
-
- com.composum.sling.clientlibs.processor.ProcessorPipeline
-
- All Implemented Interfaces:
ClientlibProcessor
public class ProcessorPipeline extends Object implements ClientlibProcessor
-
-
Field Summary
Fields Modifier and Type Field Description protected List<ClientlibProcessor>
processors
-
Fields inherited from interface com.composum.sling.clientlibs.service.ClientlibProcessor
DEFAULT_CHARSET
-
-
Constructor Summary
Constructors Constructor Description ProcessorPipeline(ClientlibProcessor... processors)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addProcessor(int index, ClientlibProcessor processor)
void
addProcessor(ClientlibProcessor processor)
InputStream
processContent(InputStream stream, ProcessorContext context)
Transforms the content and result in a stream with the probably changed content - for pipes.String
toString()
-
-
-
Field Detail
-
processors
protected List<ClientlibProcessor> processors
-
-
Constructor Detail
-
ProcessorPipeline
public ProcessorPipeline(ClientlibProcessor... processors)
-
-
Method Detail
-
addProcessor
public void addProcessor(ClientlibProcessor processor)
-
addProcessor
public void addProcessor(int index, ClientlibProcessor processor)
-
processContent
public InputStream processContent(InputStream stream, ProcessorContext context) throws IOException
Description copied from interface:ClientlibProcessor
Transforms the content and result in a stream with the probably changed content - for pipes.- Specified by:
processContent
in interfaceClientlibProcessor
- Parameters:
stream
- the original to process by the processor. the processor returns a different stream, this must be closed by the processor.- Returns:
- the transformation result - might also be the originial sourceStream if switched off
- Throws:
IOException
-
-