Module org.apache.wicket.core
Package org.apache.wicket.markup.html
Class HeaderResponseDecoratorCollection
java.lang.Object
org.apache.wicket.markup.html.HeaderResponseDecoratorCollection
- All Implemented Interfaces:
IHeaderResponseDecorator
A collection of
IHeaderResponseDecorator
s. The decorators will be nested oldest on the
inside, newest on the outside. By default ResourceAggregator
is already registered.- Author:
- Emond Papegaaij
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionadd
(IHeaderResponseDecorator decorator) Adds a newIHeaderResponseDecorator
that will decorates prior to all already registered decorators.Adds a newIHeaderResponseDecorator
that decorates after all already registered decorators.Adds a newIHeaderResponseDecorator
that decorates immediately prior to resource aggregation.decorate
(IHeaderResponse response) The method that does the decorating of the IHeaderResponse.replaceAll
(IHeaderResponseDecorator decorator) Replaces all registeredIHeaderResponseDecorator
s with the given decorator.
-
Constructor Details
-
HeaderResponseDecoratorCollection
public HeaderResponseDecoratorCollection()
-
-
Method Details
-
add
Adds a newIHeaderResponseDecorator
that will decorates prior to all already registered decorators. That means, the first to be added will be wrapped by aResourceAggregator
like this:new ResourceAggregator(first)
. The second will be wrapped by the first and the aggregator:new ResourceAggregator(first(second))
.- Parameters:
decorator
- The decorator to add, cannot be null.- Returns:
this
for chaining.
-
addPreResourceAggregationDecorator
public HeaderResponseDecoratorCollection addPreResourceAggregationDecorator(IHeaderResponseDecorator decorator) Adds a newIHeaderResponseDecorator
that decorates immediately prior to resource aggregation.- Parameters:
decorator
- The decorator to add, cannot be null.- Returns:
this
for chaining.- See Also:
-
addPostProcessingDecorator
public HeaderResponseDecoratorCollection addPostProcessingDecorator(IHeaderResponseDecorator decorator) Adds a newIHeaderResponseDecorator
that decorates after all already registered decorators.- Parameters:
decorator
- The decorator to add, cannot be null.- Returns:
this
for chaining.
-
replaceAll
Replaces all registeredIHeaderResponseDecorator
s with the given decorator. This also removes theResourceAggregator
, which is required to render resource dependencies.- Parameters:
decorator
- The decorator to add, cannot be null.- Returns:
this
for chaining.
-
decorate
Description copied from interface:IHeaderResponseDecorator
The method that does the decorating of the IHeaderResponse.- Specified by:
decorate
in interfaceIHeaderResponseDecorator
- Parameters:
response
- the original response created by Wicket- Returns:
- the response to be used by IHeaderContributors
-