public class PropertyTypeRegistry<T> extends Object
Registry mapping properties by name to the type they are supposed to be. Additionally allowing for custom type conversion strategy to be defined. If no property is defined with that name, the registry will return the default type.
A PropertyDefinitionRegistry is used as the configuration for a TypedPropertyMap.
| Constructor and Description |
|---|
PropertyTypeRegistry() |
PropertyTypeRegistry(Class classForUnknownProperties) |
PropertyTypeRegistry(Class classForUnknownProperties,
org.springframework.core.convert.ConversionService conversionService) |
PropertyTypeRegistry(org.springframework.core.convert.ConversionService conversionService) |
| Modifier and Type | Method and Description |
|---|---|
void |
clear() |
Class |
getClassForProperty(T propertyKey) |
Class |
getClassForUnknownProperties() |
org.springframework.core.convert.ConversionService |
getConversionServiceForProperty(T propertyKey) |
org.springframework.core.convert.ConversionService |
getDefaultConversionService() |
Object |
getDefaultValueForProperty(T propertyKey) |
Collection<T> |
getRegisteredProperties() |
org.springframework.core.convert.TypeDescriptor |
getTypeForProperty(T propertyKey) |
boolean |
isEmpty() |
boolean |
isRegistered(T propertyKey) |
void |
register(T propertyKey,
Class propertyClass) |
<A> void |
register(T propertyKey,
Class<A> propertyClass,
PropertyFactory<T,A> defaultValueFactory) |
<A> void |
register(T propertyKey,
Class<A> propertyClass,
PropertyFactory<T,A> defaultValueFactory,
org.springframework.core.convert.ConversionService conversionService) |
void |
register(T propertyKey,
org.springframework.core.convert.TypeDescriptor propertyType) |
void |
register(T propertyKey,
org.springframework.core.convert.TypeDescriptor propertyType,
PropertyFactory<T,?> defaultValueFactory) |
void |
register(T propertyKey,
org.springframework.core.convert.TypeDescriptor propertyType,
PropertyFactory<T,?> defaultValueFactory,
org.springframework.core.convert.ConversionService conversionService) |
void |
setClassForUnknownProperties(Class classForUnknownProperties) |
void |
setDefaultConversionService(org.springframework.core.convert.ConversionService defaultConversionService) |
void |
unregister(T propertyKey) |
public PropertyTypeRegistry()
public PropertyTypeRegistry(org.springframework.core.convert.ConversionService conversionService)
public PropertyTypeRegistry(Class classForUnknownProperties)
public PropertyTypeRegistry(Class classForUnknownProperties, org.springframework.core.convert.ConversionService conversionService)
public void setDefaultConversionService(org.springframework.core.convert.ConversionService defaultConversionService)
public org.springframework.core.convert.ConversionService getDefaultConversionService()
public void register(T propertyKey, org.springframework.core.convert.TypeDescriptor propertyType)
public <A> void register(T propertyKey, Class<A> propertyClass, PropertyFactory<T,A> defaultValueFactory)
public void register(T propertyKey, org.springframework.core.convert.TypeDescriptor propertyType, PropertyFactory<T,?> defaultValueFactory)
public <A> void register(T propertyKey, Class<A> propertyClass, PropertyFactory<T,A> defaultValueFactory, org.springframework.core.convert.ConversionService conversionService)
public void register(T propertyKey, org.springframework.core.convert.TypeDescriptor propertyType, PropertyFactory<T,?> defaultValueFactory, org.springframework.core.convert.ConversionService conversionService)
public void unregister(T propertyKey)
public org.springframework.core.convert.TypeDescriptor getTypeForProperty(T propertyKey)
public org.springframework.core.convert.ConversionService getConversionServiceForProperty(T propertyKey)
public Class getClassForUnknownProperties()
public void setClassForUnknownProperties(Class classForUnknownProperties)
public boolean isRegistered(T propertyKey)
public Collection<T> getRegisteredProperties()
public boolean isEmpty()
public void clear()
Copyright © 2017. All rights reserved.