public class FilteringHeaderResponse extends DecoratingHeaderResponse
HeaderResponseContainer,
CssAcceptingHeaderResponseFilter,
JavaScriptAcceptingHeaderResponseFilter| Modifier and Type | Class and Description |
|---|---|
static interface |
FilteringHeaderResponse.IHeaderResponseFilter
A filter used to bucket your resources, inline scripts, etc, into different responses.
|
| Modifier and Type | Field and Description |
|---|---|
static String |
DEFAULT_HEADER_FILTER_NAME
The default name of the filter that will collect contributions which should be rendered
in the page's <head>
|
| Constructor and Description |
|---|
FilteringHeaderResponse(IHeaderResponse response)
Constructor without explicit filters.
|
FilteringHeaderResponse(IHeaderResponse response,
String headerFilterName,
Iterable<? extends FilteringHeaderResponse.IHeaderResponseFilter> filters)
Construct.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Mark Header rendering is completed and subsequent usage will be ignored.
|
static FilteringHeaderResponse |
get() |
CharSequence |
getContent(String filterName)
Gets the content that was rendered to this header response and matched the filter with the
given name.
|
void |
render(HeaderItem item)
Renders the given
HeaderItem to the response if none of the
tokens of the item has been rendered before. |
protected void |
render(HeaderItem item,
List<HeaderItem> filteredItems) |
protected void |
setFilters(Iterable<? extends FilteringHeaderResponse.IHeaderResponseFilter> filters) |
getRealResponse, getResponse, isClosed, markRendered, wasRenderedpublic static final String DEFAULT_HEADER_FILTER_NAME
public FilteringHeaderResponse(IHeaderResponse response)
response - the wrapped IHeaderResponseHeaderResponseContainerpublic FilteringHeaderResponse(IHeaderResponse response, String headerFilterName, Iterable<? extends FilteringHeaderResponse.IHeaderResponseFilter> filters)
response - the wrapped IHeaderResponseheaderFilterName - the name that the filter for things that should appear in the head (default Wicket
location) usesfilters - the filters to use to bucket things. There will be a bucket created for each
filter, by name. There should typically be at least one filter with the same name
as your headerFilterNameprotected void setFilters(Iterable<? extends FilteringHeaderResponse.IHeaderResponseFilter> filters)
public static FilteringHeaderResponse get()
public void render(HeaderItem item)
IHeaderResponseHeaderItem to the response if none of the
tokens of the item has been rendered before.render in interface IHeaderResponserender in class DecoratingHeaderResponseitem - The item to render.public void close()
IHeaderResponseclose in interface Closeableclose in interface AutoCloseableclose in interface IHeaderResponseclose in class DecoratingHeaderResponsepublic final CharSequence getContent(String filterName)
filterName - the name of the filter to get the bucket forprotected void render(HeaderItem item, List<HeaderItem> filteredItems)
Copyright © 2006–2014 Apache Software Foundation. All rights reserved.