Class AbstractPropertyValueExtractor
java.lang.Object
io.jmix.search.index.mapping.propertyvalue.impl.AbstractPropertyValueExtractor
- All Implemented Interfaces:
PropertyValueExtractor
- Direct Known Subclasses:
EnumPropertyValueExtractor
,FilePropertyValueExtractor
,ReferencePropertyValueExtractor
,SimplePropertyValueExtractor
public abstract class AbstractPropertyValueExtractor
extends Object
implements PropertyValueExtractor
Base class for
PropertyValueExtractor
implementations.-
Field Summary
Modifier and TypeFieldDescriptionprotected static final com.fasterxml.jackson.databind.ObjectMapper
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected Object
getFlatValueOrNull
(Object entity, MetaPropertyPath propertyPath, Map<String, Object> parameters) com.fasterxml.jackson.databind.JsonNode
Extracts value from entity instance.protected boolean
isCollection
(Object value) protected abstract boolean
isSupported
(Object entity, MetaPropertyPath propertyPath, Map<String, Object> parameters) Checks if this value mapper supports value extraction of provided property.protected com.fasterxml.jackson.databind.JsonNode
processValue
(Object value, Map<String, Object> parameters) protected abstract com.fasterxml.jackson.databind.JsonNode
transformMultipleValues
(Iterable<?> values, Map<String, Object> parameters) Transform extracted value of multi-value property into result json.protected abstract com.fasterxml.jackson.databind.JsonNode
transformSingleValue
(Object value, Map<String, Object> parameters) Transform extracted value of single-value property into result json.
-
Field Details
-
objectMapper
protected static final com.fasterxml.jackson.databind.ObjectMapper objectMapper
-
-
Constructor Details
-
AbstractPropertyValueExtractor
public AbstractPropertyValueExtractor()
-
-
Method Details
-
getValue
public com.fasterxml.jackson.databind.JsonNode getValue(Object entity, MetaPropertyPath propertyPath, Map<String, Object> parameters) Description copied from interface:PropertyValueExtractor
Extracts value from entity instance.- Specified by:
getValue
in interfacePropertyValueExtractor
- Parameters:
entity
- instancepropertyPath
- propertyparameters
- runtime parameters- Returns:
- extracted value as json
-
isSupported
protected abstract boolean isSupported(Object entity, MetaPropertyPath propertyPath, Map<String, Object> parameters) Checks if this value mapper supports value extraction of provided property.- Parameters:
entity
- instancepropertyPath
- propertyparameters
- parameters- Returns:
- true if value mapper supports this property, false otherwise
-
transformSingleValue
protected abstract com.fasterxml.jackson.databind.JsonNode transformSingleValue(Object value, Map<String, Object> parameters) Transform extracted value of single-value property into result json.- Parameters:
value
- value of single-value propertyparameters
- parameters- Returns:
- value as json
-
transformMultipleValues
protected abstract com.fasterxml.jackson.databind.JsonNode transformMultipleValues(Iterable<?> values, Map<String, Object> parameters) Transform extracted value of multi-value property into result json.- Parameters:
values
- values of multi-value propertyparameters
- parameters- Returns:
- value as json
-
isCollection
-
processValue
-
getFlatValueOrNull
-