Class TextMetaDataCollectionExtractingProcessor
java.lang.Object
org.craftercms.core.processors.impl.TextMetaDataCollectionExtractingProcessor
- All Implemented Interfaces:
ItemProcessor
ItemProcessor that extracts a list of text values from descriptor
XPath-selected nodes and sets them as the
properties of the item. For extracting single values from a node use TextMetaDataExtractingProcessor.- Author:
- Sumer Jabri, Alfonso Vásquez
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected String[]Array of XPath queries for the nodes whose values should be extracted. -
Constructor Summary
ConstructorsConstructorDescriptionTextMetaDataCollectionExtractingProcessor(String... metaDataNodesXPathQueries) Default constructor. -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns true if the specifiedTextMetaDataCollectionExtractingProcessor's and this instance'smetaDataNodesXPathQueriesare equal.inthashCode()Returns the hash code for this instance, which is basically hash code of the list of XPath queries.process(Context context, CachingOptions cachingOptions, Item item) For every XPath query provided inmetaDataNodesXPathQueries, a list of nodes is selected and for each one of these nodes its text value is extracted and added to a list that is later put in the item's properties.toString()Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.craftercms.core.processors.ItemProcessor
isExclusive
-
Field Details
-
metaDataNodesXPathQueries
Array of XPath queries for the nodes whose values should be extracted.
-
-
Constructor Details
-
TextMetaDataCollectionExtractingProcessor
Default constructor. Sets themetaDataNodesXPathQueriesto the provided argument.
-
-
Method Details
-
process
public Item process(Context context, CachingOptions cachingOptions, Item item) throws ItemProcessingException For every XPath query provided inmetaDataNodesXPathQueries, a list of nodes is selected and for each one of these nodes its text value is extracted and added to a list that is later put in the item's properties.- Specified by:
processin interfaceItemProcessor- Parameters:
context- the current contextcachingOptions- caching options in case you need access to itemsitem- the item to process- Returns:
- the modified item or a new item.
- Throws:
ItemProcessingException- if an error occurred while processing the item
-
equals
Returns true if the specifiedTextMetaDataCollectionExtractingProcessor's and this instance'smetaDataNodesXPathQueriesare equal. -
hashCode
public int hashCode()Returns the hash code for this instance, which is basically hash code of the list of XPath queries. As with any otherItemProcessor, this method is defined because any processor which is passed in the method call of aContentStoreServicecan be used as part of a key for caching. -
toString
-