Right now FreeMarkerConfigurationFactory can only be used to set settings with no way to know what the currently configured settings are. We'd like to use it as a source for a customizer in Spring Boot but the current API does not allow us to do that.

For instance, we'd like to add a variable or know variables are currently configured but the API does not allow us to know what the current variables are.

See https://github.com/spring-projects/spring-boot/issues/8965

Comment From: ielatif

@snicoll if I got it right, the requested change is to introduce accessors for freemarkerSettings and freemarkerVariables in FreeMarkerConfigurationFactory?

Comment From: snicoll

I don’t know yet otherwise I would have provided more details. I’ve added an extra label to make that more explicit.

Comment From: IonasSoftwareLtd

It appears that using BeanPostProcessor#postProcessBeforeInitialization() is the only way add global variables: https://github.com/spring-projects/spring-boot/issues/8965#issuecomment-428371462

Comment From: snicoll

On a second though, the current setter is more consistent with the approach we're using for factory classes.