Class CrafterCacheAwareConfiguration
java.lang.Object
freemarker.core.Configurable
freemarker.template.Configuration
org.craftercms.engine.util.freemarker.CrafterCacheAwareConfiguration
- All Implemented Interfaces:
freemarker.core.ParserConfiguration
,Cloneable
public class CrafterCacheAwareConfiguration
extends freemarker.template.Configuration
Extension of Freemarker's
Configuration
that caches the result of getTemplate()
in Crafter's own
cache, which handles key-based smart locking so that the same template is not compiled several times by concurrent
threads.- Since:
- 3.1.5
- Author:
- avasquez
-
Nested Class Summary
Nested classes/interfaces inherited from class freemarker.core.Configurable
freemarker.core.Configurable.SettingValueAssignmentException, freemarker.core.Configurable.UnknownSettingException
-
Field Summary
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, 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, 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
ConstructorDescriptionCrafterCacheAwareConfiguration
(freemarker.template.Version incompatibleImprovements, boolean cacheTemplates) -
Method Summary
Modifier and TypeMethodDescriptionfreemarker.template.Template
getTemplate
(String name, Locale locale, Object customLookupCondition, String encoding, boolean parseAsFTL, boolean ignoreMissing) Methods inherited from class freemarker.template.Configuration
clearEncodingMap, clearSharedVariables, clearTemplateCache, clone, doAutoImportsAndIncludes, getAutoEscapingPolicy, getCacheStorage, getCorrectedNameForUnknownSetting, getDefaultConfiguration, getDefaultEncoding, getDefaultObjectWrapper, getEncoding, getFallbackOnNullLoopVariable, getIncompatibleEnhancements, getIncompatibleImprovements, getInterpolationSyntax, getLocalizedLookup, getNamingConvention, getOutputFormat, getOutputFormat, getParsedIncompatibleEnhancements, getRecognizeStandardFileExtensions, getRegisteredCustomOutputFormats, getSettingNames, getSharedVariable, getSharedVariableNames, getStrictSyntaxMode, getSupportedBuiltInDirectiveNames, getSupportedBuiltInDirectiveNames, getSupportedBuiltInNames, getSupportedBuiltInNames, getTabSize, getTagSyntax, 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, setIncompatibleImprovements, 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, 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
-
cacheTemplates
protected boolean cacheTemplates
-
-
Constructor Details
-
CrafterCacheAwareConfiguration
public CrafterCacheAwareConfiguration(freemarker.template.Version incompatibleImprovements, boolean cacheTemplates)
-
-
Method Details
-
getTemplate
public freemarker.template.Template getTemplate(String name, Locale locale, Object customLookupCondition, String encoding, boolean parseAsFTL, boolean ignoreMissing) throws IOException - Overrides:
getTemplate
in classfreemarker.template.Configuration
- Throws:
IOException
-