Author: ehillenius
Date: Thu Jan 18 10:51:31 2007
New Revision: 497534

URL: http://svn.apache.org/viewvc?view=rev&rev=497534
Log:
sorted members

Modified:
    incubator/wicket/trunk/wicket/src/main/java/wicket/markup/MarkupCache.java

Modified: 
incubator/wicket/trunk/wicket/src/main/java/wicket/markup/MarkupCache.java
URL: 
http://svn.apache.org/viewvc/incubator/wicket/trunk/wicket/src/main/java/wicket/markup/MarkupCache.java?view=diff&rev=497534&r1=497533&r2=497534
==============================================================================
--- incubator/wicket/trunk/wicket/src/main/java/wicket/markup/MarkupCache.java 
(original)
+++ incubator/wicket/trunk/wicket/src/main/java/wicket/markup/MarkupCache.java 
Thu Jan 18 10:51:31 2007
@@ -69,23 +69,6 @@
        }
 
        /**
-        * Clear markup cache and force reload of all markup data
-        */
-       public void clear()
-       {
-               this.afterLoadListeners.clear();
-               this.markupCache.clear();
-       }
-
-       /**
-        * @return the number of elements currently in the cache.
-        */
-       public int size()
-       {
-               return markupCache.size();
-       }
-
-       /**
         * Add a listener which is triggered after the resource has been 
(re-)loaded
         * 
         * @param resourceStream
@@ -100,24 +83,10 @@
        /**
         * Clear markup cache and force reload of all markup data
         */
-       public void removeAllListeners()
+       public void clear()
        {
                this.afterLoadListeners.clear();
-       }
-
-       /**
-        * Remove the markup from the cache and trigger all associated listeners
-        * 
-        * @param markupResourceStream
-        *            The resource stream
-        */
-       public final void removeMarkup(final MarkupResourceStream 
markupResourceStream)
-       {
-               markupCache.remove(markupResourceStream.getCacheKey());
-
-               // trigger all listeners registered on the markup that is 
removed
-               afterLoadListeners.notifyListeners(markupResourceStream);
-               afterLoadListeners.remove(markupResourceStream);
+               this.markupCache.clear();
        }
 
        /**
@@ -160,18 +129,6 @@
        }
 
        /**
-        * Check if container has associated markup
-        * 
-        * @param container
-        *            The container the markup should be associated with
-        * @return True if this markup container has associated markup
-        */
-       public final boolean hasAssociatedMarkup(final MarkupContainer 
container)
-       {
-               return getMarkup(container, container.getClass()) != 
MarkupFragment.NO_MARKUP_FRAGMENT;
-       }
-
-       /**
         * THIS METHOD IS NOT PART OF THE WICKET PUBLIC API. DO NOT IMPLEMENT 
IT.
         * 
         * Gets any (immutable) markup resource for the container or any of its
@@ -273,38 +230,58 @@
        }
 
        /**
-        * Determine the markup resource stream provider to be used
+        * Check if container has associated markup
         * 
         * @param container
-        *            The MarkupContainer requesting the markup resource stream
-        * @return IMarkupResourceStreamProvider
+        *            The container the markup should be associated with
+        * @return True if this markup container has associated markup
         */
-       protected IMarkupResourceStreamProvider getMarkupResourceStreamProvider(
-                       final MarkupContainer container)
+       public final boolean hasAssociatedMarkup(final MarkupContainer 
container)
        {
-               if (container instanceof IMarkupResourceStreamProvider)
-               {
-                       return (IMarkupResourceStreamProvider)container;
-               }
+               return getMarkup(container, container.getClass()) != 
MarkupFragment.NO_MARKUP_FRAGMENT;
+       }
 
-               return new DefaultMarkupResourceStreamProvider();
+       /**
+        * Clear markup cache and force reload of all markup data
+        */
+       public void removeAllListeners()
+       {
+               this.afterLoadListeners.clear();
        }
 
        /**
-        * Determine the markup cache key provider to be used
+        * Remove the markup from the cache and trigger all associated listeners
         * 
-        * @param container
-        *            The MarkupContainer requesting the markup resource stream
-        * @return IMarkupResourceStreamProvider
+        * @param markupResourceStream
+        *            The resource stream
         */
-       protected IMarkupCacheKeyProvider getMarkupCacheKeyProvider(final 
MarkupContainer container)
+       public final void removeMarkup(final MarkupResourceStream 
markupResourceStream)
        {
-               if (container instanceof IMarkupCacheKeyProvider)
-               {
-                       return (IMarkupCacheKeyProvider)container;
-               }
+               markupCache.remove(markupResourceStream.getCacheKey());
 
-               return new DefaultMarkupCacheKeyProvider();
+               // trigger all listeners registered on the markup that is 
removed
+               afterLoadListeners.notifyListeners(markupResourceStream);
+               afterLoadListeners.remove(markupResourceStream);
+       }
+
+       /**
+        * In case you need a more sophisticate cache implementation.
+        * <p>
+        * Make sure that you cache implementation is thread safe.
+        * 
+        * @param markupCache
+        */
+       public void setCacheMap(Map<CharSequence, MarkupFragment> markupCache)
+       {
+               this.markupCache = markupCache;
+       }
+
+       /**
+        * @return the number of elements currently in the cache.
+        */
+       public int size()
+       {
+               return markupCache.size();
        }
 
        /**
@@ -403,24 +380,47 @@
        }
 
        /**
-        * In case there is a need to extend the default chain of MarkupLoaders
+        * Determine the markup cache key provider to be used
         * 
-        * @return MarkupLoader
+        * @param container
+        *            The MarkupContainer requesting the markup resource stream
+        * @return IMarkupResourceStreamProvider
         */
-       protected IMarkupLoader newMarkupLoader()
+       protected IMarkupCacheKeyProvider getMarkupCacheKeyProvider(final 
MarkupContainer container)
        {
-               return new DefaultMarkupLoader();
+               if (container instanceof IMarkupCacheKeyProvider)
+               {
+                       return (IMarkupCacheKeyProvider)container;
+               }
+
+               return new DefaultMarkupCacheKeyProvider();
        }
 
        /**
-        * In case you need a more sophisticate cache implementation.
-        * <p>
-        * Make sure that you cache implementation is thread safe.
+        * Determine the markup resource stream provider to be used
         * 
-        * @param markupCache
+        * @param container
+        *            The MarkupContainer requesting the markup resource stream
+        * @return IMarkupResourceStreamProvider
         */
-       public void setCacheMap(Map<CharSequence, MarkupFragment> markupCache)
+       protected IMarkupResourceStreamProvider getMarkupResourceStreamProvider(
+                       final MarkupContainer container)
        {
-               this.markupCache = markupCache;
+               if (container instanceof IMarkupResourceStreamProvider)
+               {
+                       return (IMarkupResourceStreamProvider)container;
+               }
+
+               return new DefaultMarkupResourceStreamProvider();
+       }
+
+       /**
+        * In case there is a need to extend the default chain of MarkupLoaders
+        * 
+        * @return MarkupLoader
+        */
+       protected IMarkupLoader newMarkupLoader()
+       {
+               return new DefaultMarkupLoader();
        }
 }


Reply via email to