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 voidaddProcessor(int index, ClientlibProcessor processor)voidaddProcessor(ClientlibProcessor processor)InputStreamprocessContent(InputStream stream, ProcessorContext context)Transforms the content and result in a stream with the probably changed content - for pipes.StringtoString()
-
-
-
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:ClientlibProcessorTransforms the content and result in a stream with the probably changed content - for pipes.- Specified by:
processContentin 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
-
-