org.thymeleaf.templateresolver
Interface ITemplateResolutionValidity

All Known Implementing Classes:
AlwaysValidTemplateResolutionValidity, NonCacheableTemplateResolutionValidity, TTLTemplateResolutionValidity

public interface ITemplateResolutionValidity

Common interface for all objects defining the validity of a template resolution.

These objects are queried by the Template Cache for knowing whether a template is cacheable or not, and also for determining if an existing cache entry is still valid.

A typical implementation is TTLTemplateResolutionValidity, which determines the validity of a cache entry based on a TTL (time-to-live).

Since:
1.0
Author:
Daniel Fernández

Method Summary
 boolean isCacheable()
           Returns whether the template resolution can be included into the cache or not.
 boolean isCacheStillValid()
           Returns whether this template resolution is still valid or not (and therefore its corresponding cache entry.
 

Method Detail

isCacheable

boolean isCacheable()

Returns whether the template resolution can be included into the cache or not.

Returns:
true if the parsed template can be included into the cache, false if not.

isCacheStillValid

boolean isCacheStillValid()

Returns whether this template resolution is still valid or not (and therefore its corresponding cache entry. Will only be ever called if isCacheable() returns true.

This method will be called by the Parsed Template Cache before returning a cache entry, so that it can be invalidated if needed, and so trigger a new template resolution operation.

Returns:
whether the template resolution can be still considered valid or not.


Copyright © 2012 The THYMELEAF team. All Rights Reserved.