public class ResourceAggregator extends DecoratingHeaderResponse
ResourceAggregator
implements resource dependencies, resource bundles and sorting of
resources. During the rendering of components, all HeaderItem
s are
recorded and processed at the end.Modifier and Type | Class and Description |
---|---|
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 and Description |
---|
ResourceAggregator(IHeaderResponse real)
Construct.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Mark Header rendering is completed and subsequent usage will be ignored.
|
void |
markRendered(Object object)
Marks the given object as rendered.
|
protected HeaderItem |
preserveCssDetails(CssReferenceHeaderItem item,
CssReferenceHeaderItem bundle)
Preserves the resource reference details for CSS resource replacements.
|
protected HeaderItem |
preserveDetails(HeaderItem item,
HeaderItem bundle)
Preserves the resource reference details for resource replacements.
|
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.
|
getRealResponse, getResponse, isClosed
public ResourceAggregator(IHeaderResponse real)
real
- public void markRendered(Object object)
IHeaderResponse
markRendered
in interface IHeaderResponse
markRendered
in class DecoratingHeaderResponse
object
- object to be marked as rendered.public boolean wasRendered(Object object)
IHeaderResponse
renderJavaScriptReference
and renderCSSReference
mark
the specified ResourceReference
as rendered.
renderJavaScript
marks List of two elements (first is javascript body
CharSequence and second is id) as rendered.
renderString
marks the whole string as rendered.
markRendered
can be used to mark an arbitrary object as rendered
wasRendered
in interface IHeaderResponse
wasRendered
in class DecoratingHeaderResponse
object
- Object that is queried to be renderedpublic void render(HeaderItem item)
IHeaderResponse
HeaderItem
to the response if none of the
tokens of the item has been rendered before.render
in interface IHeaderResponse
render
in class DecoratingHeaderResponse
item
- The item to render.public void close()
IHeaderResponse
close
in interface Closeable
close
in interface AutoCloseable
close
in interface IHeaderResponse
close
in class DecoratingHeaderResponse
protected HeaderItem preserveDetails(HeaderItem item, HeaderItem bundle)
WebApplication.addResourceReplacement(org.apache.wicket.request.resource.CssResourceReference, org.apache.wicket.request.resource.ResourceReference)
then the replacement will
will inherit the media attributeitem
- The replaced header itembundle
- The bundle that represents the replacementprotected HeaderItem preserveCssDetails(CssReferenceHeaderItem item, CssReferenceHeaderItem bundle)
WebApplication.addResourceReplacement(org.apache.wicket.request.resource.CssResourceReference, org.apache.wicket.request.resource.ResourceReference)
then the replacement will
will inherit the media attributeitem
- The replaced header itembundle
- The bundle that represents the replacementCopyright © 2006–2022 Apache Software Foundation. All rights reserved.