Class FreemarkerViewsRendererConfigurationProperties

java.lang.Object
freemarker.core.Configurable
freemarker.template.Configuration
io.micronaut.views.freemarker.FreemarkerViewsRendererConfigurationProperties
All Implemented Interfaces:
freemarker.core.ParserConfiguration, io.micronaut.core.util.Toggleable, FreemarkerViewsRendererConfiguration, Cloneable

@Requires(classes=freemarker.template.Configuration.class) @ConfigurationProperties("micronaut.views.freemarker") public class FreemarkerViewsRendererConfigurationProperties extends freemarker.template.Configuration implements FreemarkerViewsRendererConfiguration
ConfigurationProperties implementation of FreemarkerViewsRendererConfiguration. All configured properties are extracted from Configuration and Configurable. All Freemarker properties names are reused in the micronaut configuration. If a value is not declared and is null, the default configuration from Freemarker is used. The expected format of each value is the same from Freemarker, and no conversion or validation is done by Micronaut. All Freemarker configuration documentation is published in their site.
Since:
1.1
Author:
Jerónimo López
  • Nested Class Summary

    Nested classes/interfaces inherited from class freemarker.core.Configurable

    freemarker.core.Configurable.SettingValueAssignmentException, freemarker.core.Configurable.UnknownSettingException
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final boolean
    The default enable value.
    static final String
    The default extension.
    static final String
     

    Fields inherited from class freemarker.template.Configuration

    ANGLE_BRACKET_TAG_SYNTAX, AUTO_DETECT_NAMING_CONVENTION, AUTO_DETECT_TAG_SYNTAX, AUTO_ESCAPING_POLICY_KEY, AUTO_ESCAPING_POLICY_KEY_CAMEL_CASE, AUTO_ESCAPING_POLICY_KEY_SNAKE_CASE, AUTO_IMPORT_KEY, AUTO_IMPORT_KEY_CAMEL_CASE, AUTO_IMPORT_KEY_SNAKE_CASE, AUTO_INCLUDE_KEY, AUTO_INCLUDE_KEY_CAMEL_CASE, AUTO_INCLUDE_KEY_SNAKE_CASE, CACHE_STORAGE_KEY, CACHE_STORAGE_KEY_CAMEL_CASE, CACHE_STORAGE_KEY_SNAKE_CASE, CAMEL_CASE_NAMING_CONVENTION, DEFAULT_ENCODING_KEY, DEFAULT_ENCODING_KEY_CAMEL_CASE, DEFAULT_ENCODING_KEY_SNAKE_CASE, DEFAULT_INCOMPATIBLE_ENHANCEMENTS, DEFAULT_INCOMPATIBLE_IMPROVEMENTS, DISABLE_AUTO_ESCAPING_POLICY, DOLLAR_INTERPOLATION_SYNTAX, ENABLE_IF_DEFAULT_AUTO_ESCAPING_POLICY, ENABLE_IF_SUPPORTED_AUTO_ESCAPING_POLICY, FALLBACK_ON_NULL_LOOP_VARIABLE_KEY, FALLBACK_ON_NULL_LOOP_VARIABLE_KEY_CAMEL_CASE, FALLBACK_ON_NULL_LOOP_VARIABLE_KEY_SNAKE_CASE, FORCE_AUTO_ESCAPING_POLICY, INCOMPATIBLE_ENHANCEMENTS, INCOMPATIBLE_IMPROVEMENTS, INCOMPATIBLE_IMPROVEMENTS_KEY, INCOMPATIBLE_IMPROVEMENTS_KEY_CAMEL_CASE, INCOMPATIBLE_IMPROVEMENTS_KEY_SNAKE_CASE, INTERPOLATION_SYNTAX_KEY, INTERPOLATION_SYNTAX_KEY_CAMEL_CASE, INTERPOLATION_SYNTAX_KEY_SNAKE_CASE, LEGACY_INTERPOLATION_SYNTAX, LEGACY_NAMING_CONVENTION, LOCALIZED_LOOKUP_KEY, LOCALIZED_LOOKUP_KEY_CAMEL_CASE, LOCALIZED_LOOKUP_KEY_SNAKE_CASE, NAMING_CONVENTION_KEY, NAMING_CONVENTION_KEY_CAMEL_CASE, NAMING_CONVENTION_KEY_SNAKE_CASE, OUTPUT_FORMAT_KEY, OUTPUT_FORMAT_KEY_CAMEL_CASE, OUTPUT_FORMAT_KEY_SNAKE_CASE, PARSED_DEFAULT_INCOMPATIBLE_ENHANCEMENTS, RECOGNIZE_STANDARD_FILE_EXTENSIONS_KEY, RECOGNIZE_STANDARD_FILE_EXTENSIONS_KEY_CAMEL_CASE, RECOGNIZE_STANDARD_FILE_EXTENSIONS_KEY_SNAKE_CASE, REGISTERED_CUSTOM_OUTPUT_FORMATS_KEY, REGISTERED_CUSTOM_OUTPUT_FORMATS_KEY_CAMEL_CASE, REGISTERED_CUSTOM_OUTPUT_FORMATS_KEY_SNAKE_CASE, SQUARE_BRACKET_INTERPOLATION_SYNTAX, SQUARE_BRACKET_TAG_SYNTAX, STRICT_SYNTAX_KEY, STRICT_SYNTAX_KEY_CAMEL_CASE, STRICT_SYNTAX_KEY_SNAKE_CASE, TAB_SIZE_KEY, TAB_SIZE_KEY_CAMEL_CASE, TAB_SIZE_KEY_SNAKE_CASE, TAG_SYNTAX_KEY, TAG_SYNTAX_KEY_CAMEL_CASE, TAG_SYNTAX_KEY_SNAKE_CASE, TEMPLATE_CONFIGURATIONS_KEY, TEMPLATE_CONFIGURATIONS_KEY_CAMEL_CASE, TEMPLATE_CONFIGURATIONS_KEY_SNAKE_CASE, TEMPLATE_LOADER_KEY, TEMPLATE_LOADER_KEY_CAMEL_CASE, TEMPLATE_LOADER_KEY_SNAKE_CASE, TEMPLATE_LOOKUP_STRATEGY_KEY, TEMPLATE_LOOKUP_STRATEGY_KEY_CAMEL_CASE, TEMPLATE_LOOKUP_STRATEGY_KEY_SNAKE_CASE, TEMPLATE_NAME_FORMAT_KEY, TEMPLATE_NAME_FORMAT_KEY_CAMEL_CASE, TEMPLATE_NAME_FORMAT_KEY_SNAKE_CASE, TEMPLATE_UPDATE_DELAY_KEY, TEMPLATE_UPDATE_DELAY_KEY_CAMEL_CASE, TEMPLATE_UPDATE_DELAY_KEY_SNAKE_CASE, VERSION_2_3_0, VERSION_2_3_19, VERSION_2_3_20, VERSION_2_3_21, VERSION_2_3_22, VERSION_2_3_23, VERSION_2_3_24, VERSION_2_3_25, VERSION_2_3_26, VERSION_2_3_27, VERSION_2_3_28, VERSION_2_3_29, VERSION_2_3_30, VERSION_2_3_31, VERSION_2_3_32, VERSION_2_3_33, WHITESPACE_STRIPPING_KEY, WHITESPACE_STRIPPING_KEY_CAMEL_CASE, WHITESPACE_STRIPPING_KEY_SNAKE_CASE

    Fields inherited from class freemarker.core.Configurable

    API_BUILTIN_ENABLED_KEY, API_BUILTIN_ENABLED_KEY_CAMEL_CASE, API_BUILTIN_ENABLED_KEY_SNAKE_CASE, ARITHMETIC_ENGINE_KEY, ARITHMETIC_ENGINE_KEY_CAMEL_CASE, ARITHMETIC_ENGINE_KEY_SNAKE_CASE, ATTEMPT_EXCEPTION_REPORTER_KEY, ATTEMPT_EXCEPTION_REPORTER_KEY_CAMEL_CASE, ATTEMPT_EXCEPTION_REPORTER_KEY_SNAKE_CASE, AUTO_FLUSH_KEY, AUTO_FLUSH_KEY_CAMEL_CASE, AUTO_FLUSH_KEY_SNAKE_CASE, BOOLEAN_FORMAT_KEY, BOOLEAN_FORMAT_KEY_CAMEL_CASE, BOOLEAN_FORMAT_KEY_SNAKE_CASE, C_FORMAT_KEY, C_FORMAT_KEY_CAMEL_CASE, C_FORMAT_KEY_SNAKE_CASE, CLASSIC_COMPATIBLE_KEY, CLASSIC_COMPATIBLE_KEY_CAMEL_CASE, CLASSIC_COMPATIBLE_KEY_SNAKE_CASE, CUSTOM_DATE_FORMATS_KEY, CUSTOM_DATE_FORMATS_KEY_CAMEL_CASE, CUSTOM_DATE_FORMATS_KEY_SNAKE_CASE, CUSTOM_NUMBER_FORMATS_KEY, CUSTOM_NUMBER_FORMATS_KEY_CAMEL_CASE, CUSTOM_NUMBER_FORMATS_KEY_SNAKE_CASE, DATE_FORMAT_KEY, DATE_FORMAT_KEY_CAMEL_CASE, DATE_FORMAT_KEY_SNAKE_CASE, DATETIME_FORMAT_KEY, DATETIME_FORMAT_KEY_CAMEL_CASE, DATETIME_FORMAT_KEY_SNAKE_CASE, LAZY_AUTO_IMPORTS_KEY, LAZY_AUTO_IMPORTS_KEY_CAMEL_CASE, LAZY_AUTO_IMPORTS_KEY_SNAKE_CASE, LAZY_IMPORTS_KEY, LAZY_IMPORTS_KEY_CAMEL_CASE, LAZY_IMPORTS_KEY_SNAKE_CASE, LOCALE_KEY, LOCALE_KEY_CAMEL_CASE, LOCALE_KEY_SNAKE_CASE, LOG_TEMPLATE_EXCEPTIONS_KEY, LOG_TEMPLATE_EXCEPTIONS_KEY_CAMEL_CASE, LOG_TEMPLATE_EXCEPTIONS_KEY_SNAKE_CASE, NEW_BUILTIN_CLASS_RESOLVER_KEY, NEW_BUILTIN_CLASS_RESOLVER_KEY_CAMEL_CASE, NEW_BUILTIN_CLASS_RESOLVER_KEY_SNAKE_CASE, NUMBER_FORMAT_KEY, NUMBER_FORMAT_KEY_CAMEL_CASE, NUMBER_FORMAT_KEY_SNAKE_CASE, OBJECT_WRAPPER_KEY, OBJECT_WRAPPER_KEY_CAMEL_CASE, OBJECT_WRAPPER_KEY_SNAKE_CASE, OUTPUT_ENCODING_KEY, OUTPUT_ENCODING_KEY_CAMEL_CASE, OUTPUT_ENCODING_KEY_SNAKE_CASE, SHOW_ERROR_TIPS_KEY, SHOW_ERROR_TIPS_KEY_CAMEL_CASE, SHOW_ERROR_TIPS_KEY_SNAKE_CASE, SQL_DATE_AND_TIME_TIME_ZONE_KEY, SQL_DATE_AND_TIME_TIME_ZONE_KEY_CAMEL_CASE, SQL_DATE_AND_TIME_TIME_ZONE_KEY_SNAKE_CASE, STRICT_BEAN_MODELS, STRICT_BEAN_MODELS_KEY, STRICT_BEAN_MODELS_KEY_CAMEL_CASE, STRICT_BEAN_MODELS_KEY_SNAKE_CASE, TEMPLATE_EXCEPTION_HANDLER_KEY, TEMPLATE_EXCEPTION_HANDLER_KEY_CAMEL_CASE, TEMPLATE_EXCEPTION_HANDLER_KEY_SNAKE_CASE, TIME_FORMAT_KEY, TIME_FORMAT_KEY_CAMEL_CASE, TIME_FORMAT_KEY_SNAKE_CASE, TIME_ZONE_KEY, TIME_ZONE_KEY_CAMEL_CASE, TIME_ZONE_KEY_SNAKE_CASE, TRUNCATE_BUILTIN_ALGORITHM_KEY, TRUNCATE_BUILTIN_ALGORITHM_KEY_CAMEL_CASE, TRUNCATE_BUILTIN_ALGORITHM_KEY_SNAKE_CASE, URL_ESCAPING_CHARSET_KEY, URL_ESCAPING_CHARSET_KEY_CAMEL_CASE, URL_ESCAPING_CHARSET_KEY_SNAKE_CASE, WRAP_UNCHECKED_EXCEPTIONS_KEY, WRAP_UNCHECKED_EXCEPTIONS_KEY_CAMEL_CASE, WRAP_UNCHECKED_EXCEPTIONS_KEY_SNAKE_CASE
  • Constructor Summary

    Constructors
    Constructor
    Description
    FreemarkerViewsRendererConfigurationProperties(ViewsConfiguration viewsConfiguration, @Nullable String version, @Nullable io.micronaut.core.io.scan.ClassPathResourceLoader resourceLoader)
    Default contructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    @NonNull String
    The default extension to use for freemarker templates.
    freemarker.template.Version
    The FreeMarker version number where the not 100% backward compatible bug fixes and improvements that you want to enable were already implemented.
    boolean
    Whether freemarker views are enabled.
    void
    setDefaultExtension(String defaultExtension)
    Sets the default extension to use.
    void
    setEnabled(boolean enabled)
    Whether freemarker views are enabled.
    void
    setIncompatibleImprovements(freemarker.template.Version incompatibleImprovements)
    the FreeMarker version number where the not 100% backward compatible bug fixes and improvements that you want to enable were already implemented.
    void
     

    Methods inherited from class freemarker.template.Configuration

    clearEncodingMap, clearSharedVariables, clearTemplateCache, clone, doAutoImportsAndIncludes, getAutoEscapingPolicy, getCacheStorage, getCorrectedNameForUnknownSetting, getDefaultConfiguration, getDefaultEncoding, getDefaultObjectWrapper, getEncoding, getFallbackOnNullLoopVariable, getIncompatibleEnhancements, getInterpolationSyntax, getLocalizedLookup, getNamingConvention, getOutputFormat, getOutputFormat, getParsedIncompatibleEnhancements, getRecognizeStandardFileExtensions, getRegisteredCustomOutputFormats, getSettingNames, getSharedVariable, getSharedVariableNames, getStrictSyntaxMode, getSupportedBuiltInDirectiveNames, getSupportedBuiltInDirectiveNames, getSupportedBuiltInNames, getSupportedBuiltInNames, getTabSize, getTagSyntax, getTemplate, getTemplate, getTemplate, getTemplate, getTemplate, getTemplate, getTemplate, getTemplateConfigurations, getTemplateLoader, getTemplateLookupStrategy, getTemplateNameFormat, getTemplateUpdateDelayMilliseconds, getVersion, getVersionNumber, getWhitespaceStripping, isAttemptExceptionReporterExplicitlySet, isCacheStorageExplicitlySet, isCFormatExplicitlySet, isDefaultEncodingExplicitlySet, isLocaleExplicitlySet, isLogTemplateExceptionsExplicitlySet, isObjectWrapperExplicitlySet, isOutputFormatExplicitlySet, isRecognizeStandardFileExtensionsExplicitlySet, isTemplateExceptionHandlerExplicitlySet, isTemplateLoaderExplicitlySet, isTemplateLookupStrategyExplicitlySet, isTemplateNameFormatExplicitlySet, isTimeZoneExplicitlySet, isWrapUncheckedExceptionsExplicitlySet, loadBuiltInEncodingMap, removeTemplateFromCache, removeTemplateFromCache, removeTemplateFromCache, removeTemplateFromCache, removeTemplateFromCache, removeTemplateFromCache, setAllSharedVariables, setAttemptExceptionReporter, setAutoEscapingPolicy, setCacheStorage, setCFormat, setClassForTemplateLoading, setClassLoaderForTemplateLoading, setDefaultConfiguration, setDefaultEncoding, setDirectoryForTemplateLoading, setEncoding, setFallbackOnNullLoopVariable, setIncompatibleEnhancements, setInterpolationSyntax, setLocale, setLocalizedLookup, setLogTemplateExceptions, setNamingConvention, setObjectWrapper, setOutputFormat, setRecognizeStandardFileExtensions, setRegisteredCustomOutputFormats, setServletContextForTemplateLoading, setSetting, setSharedVariable, setSharedVariable, setSharedVariables, setSharedVaribles, setStrictSyntaxMode, setTabSize, setTagSyntax, setTemplateConfigurations, setTemplateExceptionHandler, setTemplateLoader, setTemplateLookupStrategy, setTemplateNameFormat, setTemplateUpdateDelay, setTemplateUpdateDelayMilliseconds, setTimeZone, setWhitespaceStripping, setWrapUncheckedExceptions, unsetAttemptExceptionReporter, unsetCacheStorage, unsetCFormat, unsetDefaultEncoding, unsetLocale, unsetLogTemplateExceptions, unsetObjectWrapper, unsetOutputFormat, unsetRecognizeStandardFileExtensions, unsetTemplateExceptionHandler, unsetTemplateLoader, unsetTemplateLookupStrategy, unsetTemplateNameFormat, unsetTimeZone, unsetWrapUncheckedExceptions

    Methods inherited from class freemarker.core.Configurable

    addAutoImport, addAutoInclude, getArithmeticEngine, getAttemptExceptionReporter, getAutoFlush, getAutoImports, getAutoImportsWithoutFallback, getAutoIncludes, getAutoIncludesWithoutFallback, getBooleanFormat, getCFormat, getClassicCompatibleAsInt, getCustomAttribute, getCustomAttributeNames, getCustomDateFormat, getCustomDateFormats, getCustomDateFormatsWithoutFallback, getCustomNumberFormat, getCustomNumberFormats, getCustomNumberFormatsWithoutFallback, getDateFormat, getDateTimeFormat, getEnvironment, getLazyAutoImports, getLazyImports, getLocale, getLogTemplateExceptions, getNewBuiltinClassResolver, getNumberFormat, getObjectWrapper, getOutputEncoding, getParent, getSetting, getSettings, getShowErrorTips, getSQLDateAndTimeTimeZone, getTemplateExceptionHandler, getTimeFormat, getTimeZone, getTruncateBuiltinAlgorithm, getURLEscapingCharset, getWrapUncheckedExceptions, hasCustomFormats, invalidSettingValueException, isAPIBuiltinEnabled, isAPIBuiltinEnabledSet, isArithmeticEngineSet, isAttemptExceptionReporterSet, isAutoFlushSet, isAutoImportsSet, isAutoIncludesSet, isBooleanFormatSet, isCFormatSet, isClassicCompatible, isClassicCompatibleSet, isCustomDateFormatsSet, isCustomNumberFormatsSet, isDateFormatSet, isDateTimeFormatSet, isLazyAutoImportsSet, isLazyImportsSet, isLocaleSet, isLogTemplateExceptionsSet, isNewBuiltinClassResolverSet, isNumberFormatSet, isObjectWrapperSet, isOutputEncodingSet, isShowErrorTipsSet, isSQLDateAndTimeTimeZoneSet, isTemplateExceptionHandlerSet, isTimeFormatSet, isTimeZoneSet, isTruncateBuiltinAlgorithmSet, isURLEscapingCharsetSet, isWrapUncheckedExceptionsSet, parseAsImportList, parseAsList, parseAsSegmentedList, removeAutoImport, removeAutoInclude, removeCustomAttribute, setAPIBuiltinEnabled, setArithmeticEngine, setAutoFlush, setAutoImports, setAutoIncludes, setBooleanFormat, setClassicCompatible, setClassicCompatibleAsInt, setCustomAttribute, setCustomDateFormats, setCustomNumberFormats, setDateFormat, setDateTimeFormat, setLazyAutoImports, setLazyImports, setNewBuiltinClassResolver, setNumberFormat, setOutputEncoding, setSettings, setShowErrorTips, setSQLDateAndTimeTimeZone, setStrictBeanModels, setTimeFormat, settingValueAssignmentException, setTruncateBuiltinAlgorithm, setURLEscapingCharset, unknownSettingException

    Methods inherited from class java.lang.Object

    equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface freemarker.core.ParserConfiguration

    getArithmeticEngine
  • Field Details

  • Constructor Details

    • FreemarkerViewsRendererConfigurationProperties

      public FreemarkerViewsRendererConfigurationProperties(ViewsConfiguration viewsConfiguration, @Property(name="micronaut.views.freemarker.incompatible-improvements") @Nullable @Nullable String version, @Nullable @Nullable io.micronaut.core.io.scan.ClassPathResourceLoader resourceLoader)
      Default contructor.
      Parameters:
      viewsConfiguration - The views configuration
      version - The minimum version
      resourceLoader - The resource loader
  • Method Details

    • isEnabled

      public boolean isEnabled()
      Whether freemarker views are enabled. Default value (true).
      Specified by:
      isEnabled in interface io.micronaut.core.util.Toggleable
      Returns:
      boolean flag indicating whether FreemarkerViewsRenderer is enabled.
    • setEnabled

      public void setEnabled(boolean enabled)
      Whether freemarker views are enabled.
      Parameters:
      enabled - True if they are.
    • getDefaultExtension

      @NonNull public @NonNull String getDefaultExtension()
      The default extension to use for freemarker templates. Default value ("ftl").
      Specified by:
      getDefaultExtension in interface FreemarkerViewsRendererConfiguration
      Returns:
      The default extension to use
    • setDefaultExtension

      public void setDefaultExtension(String defaultExtension)
      Sets the default extension to use.
      Parameters:
      defaultExtension - The default extension
    • getIncompatibleImprovements

      public freemarker.template.Version getIncompatibleImprovements()
      The FreeMarker version number where the not 100% backward compatible bug fixes and improvements that you want to enable were already implemented.

      Defaults to Configuration.DEFAULT_INCOMPATIBLE_IMPROVEMENTS.

      Specified by:
      getIncompatibleImprovements in interface FreemarkerViewsRendererConfiguration
      Specified by:
      getIncompatibleImprovements in interface freemarker.core.ParserConfiguration
      Overrides:
      getIncompatibleImprovements in class freemarker.template.Configuration
      Returns:
      An optional version number
    • setIncompatibleImprovements

      public void setIncompatibleImprovements(freemarker.template.Version incompatibleImprovements)
      the FreeMarker version number where the not 100% backward compatible bug fixes and improvements that you want to enable were already implemented. Defaults to Configuration.DEFAULT_INCOMPATIBLE_IMPROVEMENTS.
      Overrides:
      setIncompatibleImprovements in class freemarker.template.Configuration
      Parameters:
      incompatibleImprovements - The version number
    • setSettings

      public void setSettings(@MapFormat(keyFormat=UNDER_SCORE_SEPARATED_LOWER_CASE) Properties props) throws freemarker.template.TemplateException
      Overrides:
      setSettings in class freemarker.core.Configurable
      Throws:
      freemarker.template.TemplateException