Home / Class/ ConverterFactoryBeanAdapter Class — spring-boot Architecture

ConverterFactoryBeanAdapter Class — spring-boot Architecture

Architecture documentation for the ConverterFactoryBeanAdapter class in ApplicationConversionService.java from the spring-boot codebase.

Entity Profile

Relationship Graph

Source Code

core/spring-boot/src/main/java/org/springframework/boot/convert/ApplicationConversionService.java lines 551–574

	private static final class ConverterFactoryBeanAdapter extends BeanAdapter<ConverterFactory<?, ?>> {

		ConverterFactoryBeanAdapter(ConverterFactory<?, ?> bean, ResolvableType beanType) {
			super(bean, beanType);
		}

		@Override
		public boolean matches(TypeDescriptor sourceType, TypeDescriptor targetType) {
			return super.matches(sourceType, targetType)
					&& conditionalConverterCandidateMatches(bean(), sourceType, targetType)
					&& conditionalConverterCandidateMatches(getConverter(targetType::getType), sourceType, targetType);
		}

		@Override
		public @Nullable Object convert(@Nullable Object source, TypeDescriptor sourceType, TypeDescriptor targetType) {
			return convert(source, targetType, getConverter(targetType::getObjectType));
		}

		@SuppressWarnings({ "unchecked", "rawtypes" })
		private Converter<Object, ?> getConverter(Supplier<Class<?>> typeSupplier) {
			return ((ConverterFactory) bean()).getConverter(typeSupplier.get());
		}

	}

Domain

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free