Class OppositeHeaderResponseFilter
java.lang.Object
org.apache.wicket.markup.head.filter.OppositeHeaderResponseFilter
- All Implemented Interfaces:
Predicate<HeaderItem>
,FilteringHeaderResponse.IHeaderResponseFilter
public class OppositeHeaderResponseFilter
extends Object
implements FilteringHeaderResponse.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
ConstructorDescriptionConstruct. -
Method Summary
Modifier and TypeMethodDescriptionboolean
accepts
(HeaderItem item) Determines whether a given HeaderItem should be rendered in the bucket represented by this filter.getName()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.apache.wicket.markup.head.filter.FilteringHeaderResponse.IHeaderResponseFilter
test
-
Constructor Details
-
OppositeHeaderResponseFilter
public OppositeHeaderResponseFilter(String name, FilteringHeaderResponse.IHeaderResponseFilter other) Construct.- Parameters:
name
- the name used by this filter for its bucket o' stuffother
- the other filter to return the opposite of
-
-
Method Details
-
getName
- Specified by:
getName
in interfaceFilteringHeaderResponse.IHeaderResponseFilter
- Returns:
- name of the filter (used by the container that renders these resources)
-
accepts
Description copied from interface:FilteringHeaderResponse.IHeaderResponseFilter
Determines whether a given HeaderItem should be rendered in the bucket represented by this filter.- Specified by:
accepts
in interfaceFilteringHeaderResponse.IHeaderResponseFilter
- Parameters:
item
- the item to be rendered- Returns:
- true if it should be bucketed with other things in this filter
-