Class ItemProcessorResolverChain
java.lang.Object
org.craftercms.core.processors.impl.resolvers.ItemProcessorResolverChain
- All Implemented Interfaces:
ItemProcessorResolver
Composite
ItemProcessorResolver, that iterates through a list of resolvers
until one of them provides a non-null ItemProcessor.- Author:
- Sumer Jabri, Alfonso Vásquez
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ItemProcessorThe default processor to use if no resolver returns a processor.protected List<ItemProcessorResolver>The chain of resolvers. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetProcessor(Item item) Returns theItemProcessorto use for the given item.voidsetDefaultProcessor(ItemProcessor defaultProcessor) Sets the default to use if no resolver returns a processor.voidsetResolvers(List<ItemProcessorResolver> resolvers) Sets the chain of resolvers.
-
Field Details
-
defaultProcessor
The default processor to use if no resolver returns a processor. -
resolvers
The chain of resolvers.
-
-
Constructor Details
-
ItemProcessorResolverChain
public ItemProcessorResolverChain()
-
-
Method Details
-
setDefaultProcessor
Sets the default to use if no resolver returns a processor. -
setResolvers
Sets the chain of resolvers. -
getProcessor
Returns theItemProcessorto use for the given item. Iterates through the chain of resolvers until one of them returns a non-null processor. If non of them returns a processor, thedefaultProcessorwill be returned.- Specified by:
getProcessorin interfaceItemProcessorResolver
-