Class CacheableElement
java.lang.Object
io.john.amiscaray.stir.domain.elements.CacheableElement
- Direct Known Subclasses:
AbstractUIElement
public abstract class CacheableElement extends Object
The base class for element cache operations
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classCacheableElement.CacheStatus -
Field Summary
Fields Modifier and Type Field Description private StringcacheContentsThe cache contents for the elementprotected booleancacheDisabledWhether to disable caching on the elementprotected CacheableElement.CacheStatuscacheStatusUsed to keep track of the cache freshness.private booleanhasChildrenWhether the element has children elements (used for caching purposes)protected PropertyChangeSupportpropertyChangeSupportUsed to listen for object property change events to appropriately update the cache -
Constructor Summary
Constructors Constructor Description CacheableElement() -
Method Summary
Modifier and Type Method Description voidaddPropertyChangeListener(PropertyChangeListener listener)Adds an event listener for any changes to the objectvoidemptyCache()StringgetCacheContents()CacheableElement.CacheStatusgetCacheStatus()booleanisCacheDisabled()booleanisHasChildren()voidsetCacheContents(String cacheContents)voidsetCacheDisabled(boolean cacheDisabled)voidsetHasChildren(boolean hasChildren)
-
Field Details
-
propertyChangeSupport
Used to listen for object property change events to appropriately update the cache -
cacheStatus
Used to keep track of the cache freshness. See theCacheStatus enum -
cacheContents
The cache contents for the element -
hasChildren
private boolean hasChildrenWhether the element has children elements (used for caching purposes) -
cacheDisabled
protected boolean cacheDisabledWhether to disable caching on the element
-
-
Constructor Details
-
CacheableElement
public CacheableElement()
-
-
Method Details
-
getCacheStatus
-
getCacheContents
-
isHasChildren
public boolean isHasChildren() -
isCacheDisabled
public boolean isCacheDisabled() -
setHasChildren
public void setHasChildren(boolean hasChildren) -
setCacheDisabled
public void setCacheDisabled(boolean cacheDisabled) -
setCacheContents
-
emptyCache
public void emptyCache() -
addPropertyChangeListener
Adds an event listener for any changes to the object- Parameters:
listener- APropertyChangeListenerfor when an object property changes
-