public class SimplePropertyValueConversions extends Object implements PropertyValueConversions, InitializingBean
PropertyValueConversions
implementation that allows to pick a PropertyValueConverterFactory
serving
converters
. Activating cahing
allows to
reuse converters. Providing a SimplePropertyValueConverterRegistry
adds path configured converter instances.
Should be initialized
. If not, init()
will be called of fist attempt of
converter
retrieval.
Constructor and Description |
---|
SimplePropertyValueConversions() |
Modifier and Type | Method and Description |
---|---|
void |
afterPropertiesSet() |
PropertyValueConverterFactory |
getConverterFactory() |
<DV,SV,C extends PersistentProperty<C>,D extends ValueConversionContext<C>> |
getValueConverter(C property)
Get the
PropertyValueConverter for the given property. |
ValueConverterRegistry<?> |
getValueConverterRegistry()
Get the
ValueConverterRegistry used for path configured converters. |
boolean |
hasValueConverter(PersistentProperty<?> property)
Check if a
PropertyValueConverter is present for the given property. |
void |
init()
May be called just once to initialize the underlying factory with its values.
|
void |
setConverterCacheEnabled(boolean converterCacheEnabled)
Dis-/Enable caching.
|
void |
setConverterFactory(PropertyValueConverterFactory converterFactory)
|
void |
setValueConverterRegistry(ValueConverterRegistry<?> valueConverterRegistry)
Set the
converter registry for path configured converters. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
simple
public void setConverterFactory(PropertyValueConverterFactory converterFactory)
converterFactory
- must not be null.@Nullable public PropertyValueConverterFactory getConverterFactory()
public void setValueConverterRegistry(ValueConverterRegistry<?> valueConverterRegistry)
converter registry
for path configured converters. This is short for adding
a
PropertyValueConverterFactories.ConfiguredInstanceServingValueConverterFactory
at the end of a PropertyValueConverterFactories.ChainedPropertyValueConverterFactory
.valueConverterRegistry
- must not be null.@Nullable public ValueConverterRegistry<?> getValueConverterRegistry()
ValueConverterRegistry
used for path configured converters.public void setConverterCacheEnabled(boolean converterCacheEnabled)
converterCacheEnabled
- set to true to enable caching of converter
instances.public boolean hasValueConverter(PersistentProperty<?> property)
PropertyValueConversions
PropertyValueConverter
is present for the given property.hasValueConverter
in interface PropertyValueConversions
property
- must not be null.PropertyValueConverter
is available.@Nullable public <DV,SV,C extends PersistentProperty<C>,D extends ValueConversionContext<C>> PropertyValueConverter<DV,SV,D> getValueConverter(C property)
PropertyValueConversions
PropertyValueConverter
for the given property.getValueConverter
in interface PropertyValueConversions
DV
- domain-specific typeSV
- store-native typeC
- conversion context typeproperty
- must not be null.PropertyValueConverter
.public void init()
public void afterPropertiesSet() throws Exception
afterPropertiesSet
in interface InitializingBean
Exception
Copyright © 2011–2022 Pivotal Software, Inc.. All rights reserved.