org.apache.wicket.resource.filtering
Class CssAcceptingHeaderResponseFilter
java.lang.Object
org.apache.wicket.resource.filtering.AbstractHeaderResponseFilter
org.apache.wicket.resource.filtering.CssAcceptingHeaderResponseFilter
- All Implemented Interfaces:
- HeaderResponseContainerFilteringHeaderResponse.IHeaderResponseFilter
public class CssAcceptingHeaderResponseFilter
- extends AbstractHeaderResponseFilter
This filter accepts anything that appears to be CSS. All CSS that is not a resource reference (
AbstractHeaderResponseFilter.acceptOtherCss()
) is accepted. All JS that is not a resource reference (
acceptOtherJavaScript()
) is not accepted.
The references are accepted if they appear to be CSS. If the reference passed in is an instance
of AbstractResourceDependentResourceReference
, we use the AbstractResourceDependentResourceReference.ResourceType
from it to
determine if it is CSS. Otherwise, we see if the ResourceReference.name property ends with
".css".
- Author:
- Jeremy Thomerson
Method Summary |
boolean |
acceptOtherJavaScript()
Whenever a render*JavaScript method on IHeaderResponse is called that is not a
ResourceReference (i.e. |
boolean |
acceptReference(ResourceReference ref)
Determines whether a given ResourceReference should be rendered in the bucket represented
by this filter. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CssAcceptingHeaderResponseFilter
public CssAcceptingHeaderResponseFilter(String name)
- Construct.
- Parameters:
name
- name of the filter (used by the container that renders these resources)
acceptReference
public boolean acceptReference(ResourceReference ref)
- Description copied from interface:
HeaderResponseContainerFilteringHeaderResponse.IHeaderResponseFilter
- Determines whether a given ResourceReference should be rendered in the bucket represented
by this filter.
- Specified by:
acceptReference
in interface HeaderResponseContainerFilteringHeaderResponse.IHeaderResponseFilter
- Overrides:
acceptReference
in class AbstractHeaderResponseFilter
- Parameters:
ref
- the reference to be rendered
- Returns:
- true if it should be bucketed with other things in this filter
acceptOtherJavaScript
public boolean acceptOtherJavaScript()
- Description copied from interface:
HeaderResponseContainerFilteringHeaderResponse.IHeaderResponseFilter
- Whenever a render*JavaScript method on IHeaderResponse is called that is not a
ResourceReference (i.e.
IHeaderResponse.renderOnDomReadyJavaScript(String)
), this
method determines if the script should be bucketed with other things in this filter.
Note that calls to IHeaderResponse.renderJavaScriptReference(String url) are also
filtered with this method since there is no actual ResourceReference to pass
- Specified by:
acceptOtherJavaScript
in interface HeaderResponseContainerFilteringHeaderResponse.IHeaderResponseFilter
- Overrides:
acceptOtherJavaScript
in class AbstractHeaderResponseFilter
- Returns:
- true if javascript should be bucketed with other things in this filter
Copyright © 2006–2016 Apache Software Foundation. All rights reserved.