org.springframework.data.solr.core.convert
Class SolrConverterBase
java.lang.Object
org.springframework.data.solr.core.convert.SolrConverterBase
- All Implemented Interfaces:
- InitializingBean, EntityConverter<SolrPersistentEntity<?>,SolrPersistentProperty,Object,Map<String,?>>, EntityReader<Object,Map<String,?>>, EntityWriter<Object,Map<String,?>>, SolrConverter
- Direct Known Subclasses:
- MappingSolrConverter, SolrJConverter
public abstract class SolrConverterBase
- extends Object
- implements SolrConverter, InitializingBean
- Author:
- Christoph Strobl
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.springframework.data.solr.core.convert.SolrConverter |
read |
| Methods inherited from interface org.springframework.data.convert.EntityReader |
read |
SolrConverterBase
public SolrConverterBase()
write
public Collection<org.apache.solr.common.SolrInputDocument> write(Iterable<?> source)
- Description copied from interface:
SolrConverter
- Write values to
List of SolrInputDocument
- Specified by:
write in interface SolrConverter
- Returns:
- empty list if values is
null-
createAndWrite
protected org.apache.solr.common.SolrInputDocument createAndWrite(Object source)
- create a new
SolrInputDocument for given source and write values to it
- Parameters:
source -
- Returns:
getCustomConversions
public CustomConversions getCustomConversions()
- Returns:
hasCustomReadTarget
protected boolean hasCustomReadTarget(Class<?> sourceType,
Class<?> targetType)
- Parameters:
sourceType - targetType -
- Returns:
- true if custom read target defined in
customConversions
hasCustomWriteTarget
protected boolean hasCustomWriteTarget(Class<?> sourceType)
- Parameters:
sourceType -
- Returns:
- true if custom write target defined in
customConversions
hasCustomWriteTarget
protected boolean hasCustomWriteTarget(Class<?> sourceType,
Class<?> targetType)
- Parameters:
sourceType - targetType -
- Returns:
- true if custom write target defined in
customConversions
isSimpleType
protected boolean isSimpleType(Class<?> type)
- Parameters:
type -
- Returns:
- true if is simple type as defined in
customConversions
getCustomWriteTargetType
protected Class<?> getCustomWriteTargetType(Class<?> type)
- get the target conversion type
- Parameters:
type -
- Returns:
registerCutomConverters
protected void registerCutomConverters(GenericConversionService conversionService)
- register
customConversions with conversionService
- Parameters:
conversionService -
setCustomConversions
public void setCustomConversions(CustomConversions customConversions)
- Parameters:
customConversions -
getConversionService
public GenericConversionService getConversionService()
- Specified by:
getConversionService in interface EntityConverter<SolrPersistentEntity<?>,SolrPersistentProperty,Object,Map<String,?>>
canConvert
protected boolean canConvert(Class<?> sourceType,
Class<?> targetType)
- Parameters:
sourceType - targetType -
- Returns:
- true if sourceType can be converted into targetType
convert
protected <T> T convert(Object source,
Class<T> targetType)
- Convert given object into target type
- Parameters:
source - targetType -
- Returns:
afterPropertiesSet
public void afterPropertiesSet()
- Specified by:
afterPropertiesSet in interface InitializingBean
Copyright © 2011-2014-2014 Pivotal. All Rights Reserved.