org.apache.wicket.resource.filtering
Class OppositeHeaderResponseFilter

java.lang.Object
  extended by org.apache.wicket.resource.filtering.OppositeHeaderResponseFilter
All Implemented Interfaces:
HeaderResponseContainerFilteringHeaderResponse.IHeaderResponseFilter
Direct Known Subclasses:
JavaScriptAcceptingHeaderResponseFilter

public class OppositeHeaderResponseFilter
extends java.lang.Object
implements HeaderResponseContainerFilteringHeaderResponse.IHeaderResponseFilter

A filter that takes another filter and always returns the opposite of another filter. This is useful where you have two filters (i.e. one for header and one for footer) and want to ensure that nothing ever has false returned for both cases.

Author:
Jeremy Thomerson

Constructor Summary
OppositeHeaderResponseFilter(java.lang.String name, HeaderResponseContainerFilteringHeaderResponse.IHeaderResponseFilter other)
          Construct.
 
Method Summary
 boolean acceptOtherCss()
          Whenever a renderCSS* method on IHeaderResponse is called that is not a ResourceReference (i.e.
 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.
 java.lang.String getName()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OppositeHeaderResponseFilter

public OppositeHeaderResponseFilter(java.lang.String name,
                                    HeaderResponseContainerFilteringHeaderResponse.IHeaderResponseFilter other)
Construct.

Parameters:
name - the name used by this filter for its bucket o' stuff
other - the other filter to return the opposite of
Method Detail

getName

public java.lang.String getName()
Specified by:
getName in interface HeaderResponseContainerFilteringHeaderResponse.IHeaderResponseFilter
Returns:
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
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
Returns:
true if javascript should be bucketed with other things in this filter

acceptOtherCss

public boolean acceptOtherCss()
Description copied from interface: HeaderResponseContainerFilteringHeaderResponse.IHeaderResponseFilter
Whenever a renderCSS* method on IHeaderResponse is called that is not a ResourceReference (i.e. IHeaderResponse.renderCSSReference(String), or IHeaderResponse.renderCSSReference(String, String)), this method determines if the CSS reference should be bucketed with other things in this filter.

Specified by:
acceptOtherCss in interface HeaderResponseContainerFilteringHeaderResponse.IHeaderResponseFilter
Returns:
true if css should be bucketed with other things in this filter


Copyright © 2006-2011 Apache Software Foundation. All Rights Reserved.