Package org.apache.wicket.markup.html
Class HeaderResponseDecoratorCollection
- java.lang.Object
-
- org.apache.wicket.markup.html.HeaderResponseDecoratorCollection
-
- All Implemented Interfaces:
IHeaderResponseDecorator
public class HeaderResponseDecoratorCollection extends Object implements IHeaderResponseDecorator
A collection ofIHeaderResponseDecorator
s. The decorators will be nested oldest on the inside, newest on the outside. By defaultResourceAggregator
is already registered.- Author:
- Emond Papegaaij
-
-
Constructor Summary
Constructors Constructor Description HeaderResponseDecoratorCollection()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description HeaderResponseDecoratorCollection
add(IHeaderResponseDecorator decorator)
Adds a newIHeaderResponseDecorator
that will decorates prior to all already registered decorators.HeaderResponseDecoratorCollection
addPostProcessingDecorator(IHeaderResponseDecorator decorator)
Adds a newIHeaderResponseDecorator
that decorates after all already registered decorators.HeaderResponseDecoratorCollection
addPreResourceAggregationDecorator(IHeaderResponseDecorator decorator)
Adds a newIHeaderResponseDecorator
that decorates immediately prior to resource aggregation.IHeaderResponse
decorate(IHeaderResponse response)
The method that does the decorating of the IHeaderResponse.HeaderResponseDecoratorCollection
replaceAll(IHeaderResponseDecorator decorator)
Replaces all registeredIHeaderResponseDecorator
s with the given decorator.
-
-
-
Constructor Detail
-
HeaderResponseDecoratorCollection
public HeaderResponseDecoratorCollection()
-
-
Method Detail
-
add
public HeaderResponseDecoratorCollection add(IHeaderResponseDecorator decorator)
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:
ResourceAggregator
-
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
public HeaderResponseDecoratorCollection replaceAll(IHeaderResponseDecorator decorator)
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
public IHeaderResponse decorate(IHeaderResponse response)
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
-
-