Class TaggingByFieldValueProcessor
- java.lang.Object
-
- org.craftercms.core.processors.impl.AbstractTaggingProcessor
-
- org.craftercms.core.processors.impl.TaggingByFieldValueProcessor
-
- All Implemented Interfaces:
ItemProcessor
public class TaggingByFieldValueProcessor extends AbstractTaggingProcessor
ItemProcessor
that adds a new tag or field to items that have a certain tag/field and value.- Author:
- joseross
-
-
Field Summary
Fields Modifier and Type Field Description protected String
sourceField
The name of the existing field to query.protected Map<String,String>
valueMapping
Map of values, the keys can be regular expressions.-
Fields inherited from class org.craftercms.core.processors.impl.AbstractTaggingProcessor
defaultValue, newField
-
-
Constructor Summary
Constructors Constructor Description TaggingByFieldValueProcessor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object o)
protected String
getTagValues(Item item)
If this method returns null or an empty string the item will not be tagged.int
hashCode()
void
setDefaultValue(String defaultValue)
void
setSourceField(String sourceField)
void
setValueMapping(Map<String,String> valueMapping)
String
toString()
-
Methods inherited from class org.craftercms.core.processors.impl.AbstractTaggingProcessor
addNewField, process, setNewField
-
-
-
-
Method Detail
-
setSourceField
public void setSourceField(String sourceField)
-
setDefaultValue
public void setDefaultValue(String defaultValue)
- Overrides:
setDefaultValue
in classAbstractTaggingProcessor
-
getTagValues
protected String getTagValues(Item item)
Description copied from class:AbstractTaggingProcessor
If this method returns null or an empty string the item will not be tagged.- Specified by:
getTagValues
in classAbstractTaggingProcessor
- Returns:
- values to use for tagging the item
-
-