in freemarker-generator-cli/src/main/java/org/apache/freemarker/generator/cli/config/ConfigurationSupplier.java [50:74]
public Configuration get() {
try {
final Configuration configuration = new Configuration(FREEMARKER_VERSION);
// support a custom "DataSourcesAdaptor"
configuration.setAPIBuiltinEnabled(true);
configuration.setObjectWrapper(new FreeMarkerGeneratorObjectWrapper(configuration.getIncompatibleImprovements()));
// apply all "freemarker.configuration.setting" values
configuration.setSettings(freeMarkerConfigurationSettings());
// override current configuration with caller-provided settings
configuration.setDefaultEncoding(settings.getTemplateEncoding().name());
configuration.setLocale(settings.getLocale());
configuration.setOutputEncoding(settings.getOutputEncoding().name());
configuration.setTemplateLoader(templateLoader.get());
// instantiate the tools as shared FreeMarker variables
configuration.setSharedVariables(toolsSupplier.get());
return configuration;
} catch (Exception e) {
throw new RuntimeException("Failed to create FreeMarker configuration", e);
}
}