public class ItemProcessorPipeline extends Object implements ItemProcessor
ItemProcessors. The output of each processor's
ItemProcessor.process(org.craftercms.core.service.Context,
org.craftercms.core.service.CachingOptions, Item) call is passed as input to the next processor.| Modifier and Type | Field and Description |
|---|---|
protected List<ItemProcessor> |
processors
List of processors which conforms the pipeline
|
| Constructor and Description |
|---|
ItemProcessorPipeline()
Default no-args constructor.
|
ItemProcessorPipeline(ItemProcessor... processors)
Constructor that receives the list of processors (as an array) which conform the pipeline.
|
ItemProcessorPipeline(List<ItemProcessor> processors)
Constructor that receives the list of processors which conform the pipeline.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addProcessor(ItemProcessor processor)
Adds a processor to the pipeline of processors.
|
void |
addProcessors(Collection<ItemProcessor> processors)
Adds several processors to the pipeline of processors.
|
boolean |
equals(Object o)
Returns true if the specified
ItemProcessorPipeline's and this instance's list of processors are equal. |
int |
hashCode()
Returns the hash code for this instance, which is basically the hash code of the list of processors.
|
Item |
process(Context context,
CachingOptions cachingOptions,
Item item)
Processes the given
Item, by calling a pipeline of processors. |
boolean |
removeProcessor(ItemProcessor processor)
Removes a processor from the pipeline of processors.
|
void |
setProcessors(List<ItemProcessor> processors)
Sets the list of processors.
|
String |
toString() |
protected List<ItemProcessor> processors
public ItemProcessorPipeline()
public ItemProcessorPipeline(List<ItemProcessor> processors)
public ItemProcessorPipeline(ItemProcessor... processors)
public void setProcessors(List<ItemProcessor> processors)
public void addProcessor(ItemProcessor processor)
public void addProcessors(Collection<ItemProcessor> processors)
public boolean removeProcessor(ItemProcessor processor)
public Item process(Context context, CachingOptions cachingOptions, Item item) throws ItemProcessingException
Item, by calling a pipeline of processors. The output of each processor's
ItemProcessor.process(org.craftercms.core.service.Context, org.craftercms.core.service.CachingOptions,
Item) call is passed as input to the next processor.process in interface ItemProcessorcontext - the current contextcachingOptions - caching options in case you need access to itemsitem - the item to processItemProcessingException - if one of the processors in the pipeline couldn't process the itempublic boolean equals(Object o)
ItemProcessorPipeline's and this instance's list of processors are equal.public int hashCode()
ItemProcessor, this method is defined because any processor which is passed in the method call of
a ContentStoreService can be used as part of a key for caching.Copyright © 2018 CrafterCMS. All rights reserved.