org.norther.tammi.spray.filter
Interface KeyFilter

All Superinterfaces:
Filter
All Known Subinterfaces:
BeanRepositoryFilter, BranchFilter<F>, ContainerKeyFilter<V>, ContentKeyFilter, FlowFilter, FormFilter, HostFilter<F>, LayoutFilter, LinkFilter<F>, LocaleFilter, MediaContentKeyFilter<M>, MonitorFilter, MultiRepositoryFilter, PageFilter, PipeFilter<F>, RepositoryFilter, SecureContainerKeyFilter<V>, SecureKeyFilter, ServiceFilter<F>, SkinFilter, TaskFilter, TerminalFilter
All Known Implementing Classes:
AbstractMediaContentKeyFilter, DefaultBeanRepositoryFilter, DefaultBranchFilter, DefaultContainerKeyFilter, DefaultContentKeyFilter, DefaultFlowFilter, DefaultFormFilter, DefaultHostFilter, DefaultKeyFilter, DefaultLayoutFilter, DefaultLinkFilter, DefaultLocaleFilter, DefaultMediaContentKeyFilter, DefaultMonitorFilter, DefaultMultiRepositoryFilter, DefaultPageFilter, DefaultPipeFilter, DefaultRepositoryFilter, DefaultSecureContainerKeyFilter, DefaultSecureKeyFilter, DefaultServiceFilter, DefaultSkinFilter, DefaultTaskFilter, DefaultTerminalFilter

public interface KeyFilter
extends Filter

KeyFilter extends Filter by adding support for a filter key, which the filter implementation can use to obtain a parameter, attribute or other entity from the current request.

Version:
$Id: KeyFilter.java,v 1.13 2009/09/28 15:08:26 cvsimp Exp $
Author:
Ilkka Priha

Method Summary
 String getKey()
          Gets the filter key.
 String getKeyValue(ServletRequest request, ServletResponse response, FilterChain chain)
          Gets the filter key value for the specified request.
 String[] getKeyValues(ServletRequest request, ServletResponse response, FilterChain chain)
          Gets filter key values for the specified request.
 boolean isLinkedKey()
          Checks whether the filter key is part of URL links built within filter chains including this filter.
 void setKey(String key)
          Sets the filter key.
 void setLinkedKey(boolean flag)
          Sets the linked key flag.
 
Methods inherited from interface javax.servlet.Filter
destroy, doFilter, init
 

Method Detail

getKey

String getKey()
Gets the filter key.

Returns:
the filter key.

setKey

void setKey(String key)
Sets the filter key.

Parameters:
key - the filter key.

isLinkedKey

boolean isLinkedKey()
Checks whether the filter key is part of URL links built within filter chains including this filter.

Returns:
true for a linked key, otherwise false.

setLinkedKey

void setLinkedKey(boolean flag)
Sets the linked key flag. Linked keys and their values are automatically included in URL links built within filter chains including this filter.

Parameters:
flag - the linked key flag.

getKeyValue

String getKeyValue(ServletRequest request,
                   ServletResponse response,
                   FilterChain chain)
Gets the filter key value for the specified request. By default, the method returns the last request parameter mapped to the filter key.

Parameters:
request - the request.
response - the response.
chain - the filter chain.
Returns:
the key value or null.

getKeyValues

String[] getKeyValues(ServletRequest request,
                      ServletResponse response,
                      FilterChain chain)
Gets filter key values for the specified request. By default, the method returns request parameter values.

Parameters:
request - the request.
response - the response.
chain - the filter chain.
Returns:
the key values or null.


Copyright © 2004 The Norther Organization. All rights reserved.