ConfigurableConversionService class abstract
A configurable conversion service that allows dynamic registration of converters.
This interface is typically used during application bootstrap or module initialization to register additional Converter, ConverterFactory, or PairedConverter instances that will be used for type conversion across the framework.
π§ Example Usage:
final service = DefaultConversionService();
service.addConverter<String, int>(StringToIntConverter());
service.addConverterFactory<String, Enum>(StringToEnumConverterFactory());
service.addPairedConverter(MyCustomPairedConverter());
See also:
- Implemented types
- Implementers
Constructors
Properties
- hashCode β int
-
The hash code for this object.
no setterinherited
- runtimeType β Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
addConverter<
S, T> (Converter< S, T> converter, {Class<S> ? sourceType, Class<T> ? targetType}) β void -
Registers a simple Converter from one specific source type to one target type.
inherited
-
addConverterFactory(
ConverterFactory converterFactory) β void -
Registers a ConverterFactory that can produce Converter instances for a target type.
inherited
-
addNullSourceConverter(
GenericNullConverter converter) β void -
Adds a new GenericNullConverter to the list of registered converters.
inherited
-
addPairedConverter(
PairedConverter converter) β void -
Registers a PairedConverter capable of converting between multiple types.
inherited
-
addUriValidator(
UriValidator validator) β void -
Adds a new
UriValidator
to the list of registered validators.inherited -
canConvert(
Class? sourceType, Class targetType) β bool -
Determines whether objects of
sourceType
can be converted totargetType
.inherited -
convert<
T> (Object? source, Class< T> targetType, [String? qualifiedName]) β T? -
Converts the given
source
object to the specifiedtargetType
.inherited -
convertTo<
T> (Object? source, Class targetType, [Class? sourceType]) β Object? -
Converts the
source
object from a knownsourceType
to atargetType
using full type metadata viaClass
.inherited -
getUriValidators(
) β List< UriValidator> -
Returns a list of registered
UriValidator
instances.inherited -
noSuchMethod(
Invocation invocation) β dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
remove(
Class sourceType, Class targetType) β void -
Removes a registered converter between the specified source and target types.
inherited
-
removeNullSourceConverter(
GenericNullConverter converter) β void -
Removes a registered GenericNullConverter.
inherited
-
removeUriValidator(
UriValidator validator) β void -
Removes a registered
UriValidator
.inherited -
toString(
) β String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) β bool -
The equality operator.
inherited