rewrite-impl-servlet 1.0.4.Final

org.ocpsoft.rewrite.servlet.config
Class RequestParameter

java.lang.Object
  extended by org.ocpsoft.rewrite.config.DefaultConditionBuilder
      extended by org.ocpsoft.rewrite.servlet.config.HttpCondition
          extended by org.ocpsoft.rewrite.servlet.config.RequestParameter
All Implemented Interfaces:
Condition, ConditionBuilder, ConfigurationElement, Parameterized<IRequestParameter,IRequestParameter.RequestParameterParameter,String>, IRequestParameter
Direct Known Subclasses:
RequestParameter.AllRequestParameters

public class RequestParameter
extends HttpCondition
implements IRequestParameter

A Condition that inspects values returned by ServletRequest.getParameterMap()

Author:
Lincoln Baxter, III

Nested Class Summary
static class RequestParameter.AllRequestParameters
           
 
Nested classes/interfaces inherited from interface org.ocpsoft.rewrite.servlet.config.IRequestParameter
IRequestParameter.IRequestParameterParameter, IRequestParameter.RequestParameterParameter
 
Method Summary
 boolean evaluateHttp(HttpServletRewrite event, EvaluationContext context)
           
static RequestParameter exists(String name)
          Return a Header condition that matches only against the existence of a header with a name matching the given pattern.
 ParameterizedPattern getNameExpression()
           
 ParameterizedPattern getValueExpression()
           
static RequestParameter matches(String name, String value)
          Return a Header condition that matches against both header name and values.
static RequestParameter matchesAll(String name, String value)
           
static RequestParameter valueExists(String value)
          Return a Header condition that matches only against the existence of a header with value matching the given pattern.
 IRequestParameter.RequestParameterParameter where(String param)
           
 IRequestParameter.RequestParameterParameter where(String param, Binding binding)
           
 
Methods inherited from class org.ocpsoft.rewrite.servlet.config.HttpCondition
evaluate
 
Methods inherited from class org.ocpsoft.rewrite.config.DefaultConditionBuilder
and, andNot, create, or, orNot, wrap
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.ocpsoft.rewrite.config.ConditionBuilder
and, andNot, or, orNot
 
Methods inherited from interface org.ocpsoft.rewrite.config.Condition
evaluate
 

Method Detail

matches

public static RequestParameter matches(String name,
                                       String value)
Return a Header condition that matches against both header name and values.

See also: HttpServletRequest.getHeader(String)

Parameters:
name - Regular expression matching the header name
value - Regular expression matching the header value

matchesAll

public static RequestParameter matchesAll(String name,
                                          String value)

exists

public static RequestParameter exists(String name)
Return a Header condition that matches only against the existence of a header with a name matching the given pattern. The header value is ignored.

See also: HttpServletRequest.getHeader(String)

Parameters:
name - Regular expression matching the header name

valueExists

public static RequestParameter valueExists(String value)
Return a Header condition that matches only against the existence of a header with value matching the given pattern. The header name is ignored.

Parameters:
value - Regular expression matching the header value

evaluateHttp

public boolean evaluateHttp(HttpServletRewrite event,
                            EvaluationContext context)
Specified by:
evaluateHttp in class HttpCondition

where

public IRequestParameter.RequestParameterParameter where(String param)
Specified by:
where in interface Parameterized<IRequestParameter,IRequestParameter.RequestParameterParameter,String>

where

public IRequestParameter.RequestParameterParameter where(String param,
                                                         Binding binding)
Specified by:
where in interface Parameterized<IRequestParameter,IRequestParameter.RequestParameterParameter,String>

getNameExpression

public ParameterizedPattern getNameExpression()

getValueExpression

public ParameterizedPattern getValueExpression()

rewrite-impl-servlet 1.0.4.Final

Copyright © 2012 OCPsoft. All Rights Reserved.