Interface ConverterRegistry
- All Known Implementing Classes:
DefaultModelConverterRegistry
public interface ConverterRegistry
Manages
ModelConverter registered for specific keys. Only one ModelConverter can be registered for
one key.- Since:
- 4.0
-
Method Summary
Modifier and TypeMethodDescriptionvoidClears all registered converters.getMappedType(Class<?> modelClass) getModelConverterByModel(Object model) Gets the converted registered based on provided model.getModelConverterByModelType(Class<?> modelClass) Gets the converter registered by a model type.Gets the converter registered by a source type.Gets all registered converters.Allows to fetch model service.booleanhasModelConverterForModelType(Class<?> modelClass) booleanrequired by the clearing model converter registry instance see HOR-176
-
Method Details
-
getModelService
ModelService getModelService()Allows to fetch model service. This is intented to be used from inside ofModelConverterwhich are connected to this registry viaModelConverter.init(ConverterRegistry). -
getModelConverterByModelType
Gets the converter registered by a model type.- Parameters:
modelClass- modelClass for which a converter is needed- Returns:
- registered converter matching given key
-
hasModelConverterForModelType
- Returns:
trueif for the given model class aModelConverterexists.Falseotherwise.
-
getModelConverterBySourceType
Gets the converter registered by a source type.- Parameters:
key- key for which a converter is needed- Returns:
- registered converter matching given key
-
hasModelConverterForSourceType
- Returns:
trueif for the given composed type code aModelConverterexists.Falseotherwise.
-
getMappedType
- Returns:
- for the given model class the mapped jalo type code.
nullotherwise.
-
removeModelConverterBySourceType
required by the clearing model converter registry instance see HOR-176 -
getModelConverters
Collection<ModelConverter> getModelConverters()Gets all registered converters. Access to collection has to be synchronized by this in cause of probable ongoing changes. -
clearModelConverters
void clearModelConverters()Clears all registered converters. -
getModelConverterByModel
Gets the converted registered based on provided model.- Parameters:
model- Model- Returns:
- registered converted matching the given model
-