public class CachingExpressionContextDecorator extends java.lang.Object implements IExpressionContext
IExpressionContext that provides caching of
SnpsExpressionTags for a concrete IExpressionContext instance.
This implementation guarantee that multiple calls to getSnpsExpressionTags(SnpsLanguage)
will compute expression tags only once until caller invoke resetCache() or
resetCache(SnpsLanguage).
| Constructor and Description |
|---|
CachingExpressionContextDecorator(IExpressionContext pContext)
Construct a new
CachingExpressionContextDecorator. |
| Modifier and Type | Method and Description |
|---|---|
com.sunopsis.language.parser.SnpsExpressionTag[] |
getSnpsExpressionTags(com.sunopsis.language.SnpsLanguage pSnpsLanguage)
Obtains the expression tags relative to this context.
|
boolean |
isCachePopulated(com.sunopsis.language.SnpsLanguage pSnpsLanguage) |
void |
resetCache()
Reset cache of expression tags for all languages.
|
void |
resetCache(com.sunopsis.language.SnpsLanguage pSnpsLanguage)
Reset cache of expression tags for the given language.
|
public CachingExpressionContextDecorator(IExpressionContext pContext)
CachingExpressionContextDecorator.pContext - the context to manage caching forpublic com.sunopsis.language.parser.SnpsExpressionTag[] getSnpsExpressionTags(com.sunopsis.language.SnpsLanguage pSnpsLanguage)
IExpressionContextgetSnpsExpressionTags in interface IExpressionContextpSnpsLanguage - the language that will be used when manipulating the expression tags
(i.e. when building the Expression)public boolean isCachePopulated(com.sunopsis.language.SnpsLanguage pSnpsLanguage)
public void resetCache(com.sunopsis.language.SnpsLanguage pSnpsLanguage)
pSnpsLanguage - the languagepublic void resetCache()