org.apache.wicket.markup.head
Class ResourceAggregator

java.lang.Object
  extended by org.apache.wicket.markup.html.DecoratingHeaderResponse
      extended by org.apache.wicket.markup.head.ResourceAggregator
All Implemented Interfaces:
Closeable, IHeaderResponse

public class ResourceAggregator
extends DecoratingHeaderResponse

ResourceAggregator implements resource dependencies, resource bundles and sorting of resources. During the rendering of components, all HeaderItems are recorded and processed at the end.

Author:
papegaaij

Nested Class Summary
static class ResourceAggregator.RecordedHeaderItem
          Contains information about an HeaderItem that must be rendered.
static class ResourceAggregator.RecordedHeaderItemLocation
          The location in which a HeaderItem is added, consisting of the component/behavior that added the item, the index in the list for that component/behavior at which the item was added and the index in the request.
 
Constructor Summary
ResourceAggregator(IHeaderResponse real)
          Construct.
 
Method Summary
 void close()
          Mark Header rendering is completed and subsequent usage will be ignored.
 void markRendered(Object object)
          Marks the given object as rendered.
 void render(HeaderItem item)
          Renders the given HeaderItem to the response if none of the tokens of the item has been rendered before.
 boolean wasRendered(Object object)
          Returns whether the given object has been marked as rendered.
 
Methods inherited from class org.apache.wicket.markup.html.DecoratingHeaderResponse
getRealResponse, getResponse, isClosed
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ResourceAggregator

public ResourceAggregator(IHeaderResponse real)
Construct.

Parameters:
real -
Method Detail

markRendered

public void markRendered(Object object)
Description copied from interface: IHeaderResponse
Marks the given object as rendered. The object can be anything (string, resource reference, etc...). The purpose of this function is to allow user to manually keep track of rendered items. This can be useful for items that are expensive to generate (like interpolated text).

Specified by:
markRendered in interface IHeaderResponse
Overrides:
markRendered in class DecoratingHeaderResponse
Parameters:
object - object to be marked as rendered.

wasRendered

public boolean wasRendered(Object object)
Description copied from interface: IHeaderResponse
Returns whether the given object has been marked as rendered.

Specified by:
wasRendered in interface IHeaderResponse
Overrides:
wasRendered in class DecoratingHeaderResponse
Parameters:
object - Object that is queried to be rendered
Returns:
Whether the object has been marked as rendered during the request

render

public void render(HeaderItem item)
Description copied from interface: IHeaderResponse
Renders the given HeaderItem to the response if none of the tokens of the item has been rendered before.

Specified by:
render in interface IHeaderResponse
Overrides:
render in class DecoratingHeaderResponse
Parameters:
item - The item to render.

close

public void close()
Description copied from interface: IHeaderResponse
Mark Header rendering is completed and subsequent usage will be ignored. If some kind of buffering is used internally, this action will mark that the contents has to be flushed out.

Specified by:
close in interface Closeable
Specified by:
close in interface IHeaderResponse
Overrides:
close in class DecoratingHeaderResponse


Copyright © 2006-2013 Apache Software Foundation. All Rights Reserved.