@Override protected ITemplateResolutionValidity computeValidity(final TemplateProcessingParameters templateProcessingParameters) { final String templateName = templateProcessingParameters.getTemplateName(); if (this.cacheablePatternSpec.matches(templateName)) { if (this.cacheTTLMs != null) { return new TTLTemplateResolutionValidity(this.cacheTTLMs.longValue()); } return AlwaysValidTemplateResolutionValidity.INSTANCE; } if (this.nonCacheablePatternSpec.matches(templateName)) { return NonCacheableTemplateResolutionValidity.INSTANCE; } if (unsafeIsCacheable()) { if (this.cacheTTLMs != null) { return new TTLTemplateResolutionValidity(this.cacheTTLMs.longValue()); } return AlwaysValidTemplateResolutionValidity.INSTANCE; } return NonCacheableTemplateResolutionValidity.INSTANCE; }