Class SolrConverterBase
java.lang.Object
org.springframework.data.solr.core.convert.SolrConverterBase
- All Implemented Interfaces:
org.springframework.beans.factory.InitializingBean,org.springframework.data.convert.EntityConverter<SolrPersistentEntity<?>,,SolrPersistentProperty, Object, org.apache.solr.common.SolrDocumentBase> org.springframework.data.convert.EntityReader<Object,,org.apache.solr.common.SolrDocumentBase> org.springframework.data.convert.EntityWriter<Object,,org.apache.solr.common.SolrDocumentBase> SolrConverter
- Direct Known Subclasses:
MappingSolrConverter,SolrJConverter
public abstract class SolrConverterBase
extends Object
implements SolrConverter, org.springframework.beans.factory.InitializingBean
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidprotected booleancanConvert(Class<?> sourceType, Class<?> targetType) protected <T> TConvert given object into target typeprotected org.apache.solr.common.SolrInputDocumentcreateAndWrite(Object source) create a newSolrInputDocumentfor given source and write values to itorg.springframework.core.convert.support.GenericConversionServiceorg.springframework.data.convert.CustomConversionsgetCustomWriteTargetType(Class<?> type) get the target conversion typeprotected booleanhasCustomReadTarget(Class<?> sourceType, Class<?> targetType) protected booleanhasCustomWriteTarget(Class<?> sourceType) protected booleanhasCustomWriteTarget(Class<?> sourceType, Class<?> targetType) protected booleanisSimpleType(Class<?> type) protected voidregisterCustomConverters(org.springframework.core.convert.support.GenericConversionService conversionService) registercustomConversionswithconversionServicevoidsetCustomConversions(org.springframework.data.convert.CustomConversions customConversions) Collection<org.apache.solr.common.SolrInputDocument>Write values toListofSolrInputDocumentMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.data.convert.EntityConverter
getMappingContextMethods inherited from interface org.springframework.data.convert.EntityReader
readMethods inherited from interface org.springframework.data.convert.EntityWriter
writeMethods inherited from interface org.springframework.data.solr.core.convert.SolrConverter
read
-
Constructor Details
-
SolrConverterBase
public SolrConverterBase()
-
-
Method Details
-
write
Description copied from interface:SolrConverterWrite values toListofSolrInputDocument- Specified by:
writein interfaceSolrConverter- Returns:
- empty list if values is
null-
-
createAndWrite
create a newSolrInputDocumentfor given source and write values to it- Parameters:
source-- Returns:
-
getCustomConversions
public org.springframework.data.convert.CustomConversions getCustomConversions()- Returns:
-
hasCustomReadTarget
- Parameters:
sourceType-targetType-- Returns:
- true if custom read target defined in
customConversions
-
hasCustomWriteTarget
- Parameters:
sourceType-- Returns:
- true if custom write target defined in
customConversions
-
hasCustomWriteTarget
- Parameters:
sourceType-targetType-- Returns:
- true if custom write target defined in
customConversions
-
isSimpleType
- Parameters:
type-- Returns:
- true if is simple type as defined in
customConversions
-
getCustomWriteTargetType
get the target conversion type- Parameters:
type-- Returns:
-
registerCustomConverters
protected void registerCustomConverters(org.springframework.core.convert.support.GenericConversionService conversionService) registercustomConversionswithconversionService- Parameters:
conversionService-
-
setCustomConversions
public void setCustomConversions(@Nullable org.springframework.data.convert.CustomConversions customConversions) - Parameters:
customConversions-
-
getConversionService
public org.springframework.core.convert.support.GenericConversionService getConversionService()- Specified by:
getConversionServicein interfaceorg.springframework.data.convert.EntityConverter<SolrPersistentEntity<?>,SolrPersistentProperty, Object, org.apache.solr.common.SolrDocumentBase>
-
canConvert
- Parameters:
sourceType-targetType-- Returns:
- true if sourceType can be converted into targetType
-
convert
Convert given object into target type- Parameters:
source-targetType-- Returns:
-
afterPropertiesSet
public void afterPropertiesSet()- Specified by:
afterPropertiesSetin interfaceorg.springframework.beans.factory.InitializingBean
-