+ * Supported properties
+ *
+ * Property Key |
+ * Description |
+ * Default |
+ *
+ *
+ * Directive configuration |
+ *
+ *
+ * userdirective |
+ * The user defined directives (Recommend to use the 'velocity-settings.runtime.custom_directives' property
+ * because this property defined for keeping backward compatibility) |
+ * None(empty) |
+ *
+ *
+ * Additional context attribute configuration |
+ *
+ *
+ * additional.context.attributes |
+ * The user defined additional context attribute values(Recommend to use the
+ * 'additional-context-attributes.{name}' because this property defined for keeping backward compatibility) |
+ * None(empty) |
+ *
+ *
+ * additional-context-attributes.{name} |
+ * The user defined additional context attributes value(FQCN) |
+ * - |
+ *
+ *
+ * Velocity settings configuration |
+ *
+ *
+ * velocity-settings.{name} |
+ * The settings of Velocity's {@link RuntimeInstance#setProperty(String, Object)} |
+ * - |
+ *
+ *
+ * {name} |
+ * The settings of Velocity's {@link RuntimeInstance#setProperty(String, Object)} (Recommend to use the
+ * 'velocity-settings.{name}' because this property defined for keeping backward compatibility) |
+ * - |
+ *
+ *
+ *
+ * @return a configuration instance
+ */
+ public static VelocityLanguageDriverConfig newInstance() {
+ return newInstance(loadDefaultProperties());
+ }
+
+ /**
+ * Create an instance from specified properties.
+ *
+ * @param customProperties
+ * custom configuration properties
+ * @return a configuration instance
+ * @see #newInstance()
+ */
+ public static VelocityLanguageDriverConfig newInstance(Properties customProperties) {
+ VelocityLanguageDriverConfig config = new VelocityLanguageDriverConfig();
+ Properties properties = loadDefaultProperties();
+ Optional.ofNullable(customProperties).ifPresent(properties::putAll);
+ override(config, properties);
+ configureVelocitySettings(config, properties);
+ return config;
+ }
+
+ /**
+ * Create an instance using specified customizer and override using a default properties file.
+ *
+ * @param customizer
+ * baseline customizer
+ * @return a configuration instance
+ * @see #newInstance()
+ */
+ public static VelocityLanguageDriverConfig newInstance(Consumer