Class TypeConverterRegistry
java.lang.Object
org.apache.logging.log4j.core.config.plugins.convert.TypeConverterRegistry
Registry for
TypeConverter
plugins.- Since:
- 2.1
-
Method Summary
Modifier and TypeMethodDescriptionfindCompatibleConverter
(Type type) Finds aTypeConverter
for the givenType
, falling back to an assignment-compatible TypeConverter if none exist for the given type.static TypeConverterRegistry
Gets the singleton instance of the TypeConverterRegistry.
-
Method Details
-
getInstance
Gets the singleton instance of the TypeConverterRegistry.- Returns:
- the singleton instance.
-
findCompatibleConverter
Finds aTypeConverter
for the givenType
, falling back to an assignment-compatible TypeConverter if none exist for the given type. That is, if the given Type does not have a TypeConverter, but another Type which can be assigned to the given Type does have a TypeConverter, then that TypeConverter will be used and registered.- Parameters:
type
- the Type to find a TypeConverter for (must not benull
).- Returns:
- a TypeConverter for the given Type.
- Throws:
UnknownFormatConversionException
- if no TypeConverter can be found for the given type.
-