Class MetaDataProcessorResolver
java.lang.Object
org.craftercms.core.processors.impl.resolvers.MetaDataProcessorResolver
- All Implemented Interfaces:
ItemProcessorResolver
ItemProcessorResolver
that searches the item's descriptor for a processor element that defines the name of
the processor- Author:
- Alfonso Vásquez
-
Field Summary
Modifier and TypeFieldDescriptionprotected Map<String,
ItemProcessor> Mappings of processor element values to processor names.protected String
The XPath query for the processor element that defines the processor to use. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetProcessor
(Item item) Looks for the processor element (by querying it with theprocessorElementXPathQuery
) in the item's descriptor.void
setElementValueToProcessorMappings
(Map<String, ItemProcessor> elementValueToProcessorMappings) Sets the mappings of processor element values to processor names.void
setProcessorElementXPathQuery
(String processorElementXPathQuery) Sets the XPath query for the processor element that defines the processor to use.
-
Field Details
-
processorElementXPathQuery
The XPath query for the processor element that defines the processor to use. -
elementValueToProcessorMappings
Mappings of processor element values to processor names.
-
-
Constructor Details
-
MetaDataProcessorResolver
public MetaDataProcessorResolver()
-
-
Method Details
-
setProcessorElementXPathQuery
Sets the XPath query for the processor element that defines the processor to use. -
setElementValueToProcessorMappings
public void setElementValueToProcessorMappings(Map<String, ItemProcessor> elementValueToProcessorMappings) Sets the mappings of processor element values to processor names. -
getProcessor
Looks for the processor element (by querying it with theprocessorElementXPathQuery
) in the item's descriptor. If the element is found, the element value is mapped to a processor and that processor is returned.- Specified by:
getProcessor
in interfaceItemProcessorResolver
- Throws:
XmlException
- if the element value doesn't refer to an existing processor
-