public GenericConverter getConverter(TypeDescriptor sourceType, TypeDescriptor targetType) { for (GenericConverter converter : this.converters) { if (!(converter instanceof ConditionalGenericConverter) || ((ConditionalGenericConverter) converter).matches(sourceType, targetType)) { return converter; } } return null; }
/** * Creates a converter of entities to {@link String}, based on the {@link EntityFormat} * annotation provided at the class level. * * @return the entity to String converter */ public ConditionalGenericConverter getToStringConverter() { return new EntityToStringConverter(PARSER, PARSER_CONTEXT, messageSource, conversionService); }