Spring Data Solr

org.springframework.data.solr.core.convert
Class CustomConversions

java.lang.Object
  extended by org.springframework.data.solr.core.convert.CustomConversions

public class CustomConversions
extends Object

CustomConversions holds basically a list of Converter that can be used for mapping objects to ( WritingConverter) and from (ReadingConverter) solr representation.

Author:
Christoph Strobl, Rias A. Sherzad

Constructor Summary
CustomConversions()
          Create new instance
CustomConversions(List converters)
          Create new instance registering given converters
 
Method Summary
 Class<?> getCustomWriteTarget(Class<?> source)
          find most recent write target for given class
 Class<?> getCustomWriteTarget(Class<?> sourceType, Class<?> targetType)
          find most recent write target for given source and targetType
 boolean hasCustomReadTarget(Class<?> sourceType, Class<?> targetType)
          check if custom read target available for given types
 boolean hasCustomWriteTarget(Class<?> sourceType, Class<?> targetType)
          check if custom write target available for given types
 boolean isSimpleType(Class<?> clazz)
           
 void registerConvertersIn(GenericConversionService conversionService)
          Register custom converters within given GenericConversionService
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CustomConversions

public CustomConversions()
Create new instance


CustomConversions

public CustomConversions(List converters)
Create new instance registering given converters

Parameters:
converters -
Method Detail

registerConvertersIn

public void registerConvertersIn(GenericConversionService conversionService)
Register custom converters within given GenericConversionService

Parameters:
conversionService - must not be null

isSimpleType

public boolean isSimpleType(Class<?> clazz)
Parameters:
clazz -
Returns:
true if given class is considered a simple type

getCustomWriteTarget

public Class<?> getCustomWriteTarget(Class<?> source)
find most recent write target for given class

Parameters:
source - must not be null
Returns:

getCustomWriteTarget

public Class<?> getCustomWriteTarget(Class<?> sourceType,
                                     Class<?> targetType)
find most recent write target for given source and targetType

Parameters:
sourceType -
targetType -
Returns:

hasCustomReadTarget

public boolean hasCustomReadTarget(Class<?> sourceType,
                                   Class<?> targetType)
check if custom read target available for given types

Parameters:
sourceType -
targetType -
Returns:
true if custom converter registered for source/target type

hasCustomWriteTarget

public boolean hasCustomWriteTarget(Class<?> sourceType,
                                    Class<?> targetType)
check if custom write target available for given types

Parameters:
sourceType -
targetType -
Returns:

Spring Data Solr

Copyright © 2011-2014-2014 Pivotal. All Rights Reserved.