P
- persistent property type.public class SimplePropertyValueConverterRegistry<P extends PersistentProperty<P>> extends Object implements ValueConverterRegistry<P>
value convertes
that may be used to convert only
specific properties/values of an object.Constructor and Description |
---|
SimplePropertyValueConverterRegistry() |
Modifier and Type | Method and Description |
---|---|
boolean |
containsConverterFor(Class<?> type,
String path)
Check if a converter is registered for the given type, path combination.
|
<S,T> PropertyValueConverter<S,T,? extends ValueConversionContext<P>> |
getConverter(Class<?> type,
String path)
Obtain the
PropertyValueConverter registered for the given type, path combination or null
if none defined. |
boolean |
isEmpty()
Check if converters are registered.
|
void |
registerConverter(Class<?> type,
String path,
PropertyValueConverter<?,?,? extends ValueConversionContext<P>> converter)
Register the
PropertyValueConverter for the property of the given type. |
void |
registerConverterIfAbsent(Class<?> type,
String path,
PropertyValueConverter<?,?,? extends ValueConversionContext<P>> converter)
Register the
PropertyValueConverter for the property of the given type if none had been registered before. |
int |
size() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
simple
public SimplePropertyValueConverterRegistry()
public void registerConverter(Class<?> type, String path, PropertyValueConverter<?,?,? extends ValueConversionContext<P>> converter)
ValueConverterRegistry
PropertyValueConverter
for the property
of the given type.registerConverter
in interface ValueConverterRegistry<P extends PersistentProperty<P>>
type
- the target type. Must not be null.path
- the property name. Must not be null.converter
- the converter to register. Must not be null.public void registerConverterIfAbsent(Class<?> type, String path, PropertyValueConverter<?,?,? extends ValueConversionContext<P>> converter)
PropertyValueConverter
for the property of the given type if none had been registered before.type
- the target type.path
- the property name.converter
- the converter to register.public boolean containsConverterFor(Class<?> type, String path)
ValueConverterRegistry
containsConverterFor
in interface ValueConverterRegistry<P extends PersistentProperty<P>>
type
- the target type. Must not be null.path
- the property name. Must not be null.public <S,T> PropertyValueConverter<S,T,? extends ValueConversionContext<P>> getConverter(Class<?> type, String path)
ValueConverterRegistry
PropertyValueConverter
registered for the given type, path combination or null
if none defined.getConverter
in interface ValueConverterRegistry<P extends PersistentProperty<P>>
S
- domain-specific type.T
- store-specific type.type
- the target type. Must not be null.path
- the property name. Must not be null.public int size()
public boolean isEmpty()
ValueConverterRegistry
isEmpty
in interface ValueConverterRegistry<P extends PersistentProperty<P>>
Copyright © 2011–2022 Pivotal Software, Inc.. All rights reserved.