wicket.markup
Class MarkupCache

java.lang.Object
  extended by wicket.markup.MarkupCache

public class MarkupCache
extends java.lang.Object

Load markup and cache it for fast retrieval. If markup file changes, it'll be removed and subsequently reloaded when needed.

Author:
Jonathan Locke, Juergen Donnerstag

Constructor Summary
MarkupCache(Application application)
          Constructor.
 
Method Summary
 void clear()
          Clear markup cache and force reload of all markup data
 MarkupStream getMarkupStream(MarkupContainer container)
          Gets a fresh markup stream that contains the (immutable) markup resource for this class.
 MarkupStream getMarkupStream(MarkupContainer container, boolean throwException)
          Gets a fresh markup stream that contains the (immutable) markup resource for this class.
 boolean hasAssociatedMarkup(MarkupContainer container)
          Check if container has associated markup
 void removeMarkup(MarkupResourceStream markupResourceStream)
          Remove the markup from the cache and trigger all associated listeners
 int size()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MarkupCache

public MarkupCache(Application application)
Constructor.

Parameters:
application -
Method Detail

getMarkupStream

public final MarkupStream getMarkupStream(MarkupContainer container)
Gets a fresh markup stream that contains the (immutable) markup resource for this class.

Parameters:
container - The container the markup should be associated with
Returns:
A stream of MarkupElement elements

getMarkupStream

public final MarkupStream getMarkupStream(MarkupContainer container,
                                          boolean throwException)
Gets a fresh markup stream that contains the (immutable) markup resource for this class.

Parameters:
container - The container the markup should be associated with
throwException - If true, throw an exception, if markup could not be found
Returns:
A stream of MarkupElement elements

hasAssociatedMarkup

public final boolean hasAssociatedMarkup(MarkupContainer container)
Check if container has associated markup

Parameters:
container - The container the markup should be associated with
Returns:
True if this markup container has associated markup

removeMarkup

public void removeMarkup(MarkupResourceStream markupResourceStream)
Remove the markup from the cache and trigger all associated listeners

Parameters:
markupResourceStream - The resource stream
Since:
1.2.3

clear

public void clear()
Clear markup cache and force reload of all markup data


size

public int size()
Returns:
the number of elements currently in the cache.


Copyright © 2004-2007 Wicket developers. All Rights Reserved.