rewrite-impl-servlet 1.0.2.Final

org.ocpsoft.rewrite.servlet.config
Class RequestParameter

java.lang.Object
  extended by org.ocpsoft.rewrite.config.ConditionBuilder
      extended by org.ocpsoft.rewrite.servlet.config.HttpCondition
          extended by org.ocpsoft.rewrite.servlet.config.RequestParameter
All Implemented Interfaces:
Condition

public class RequestParameter
extends HttpCondition

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

Author:
Lincoln Baxter, III

Method Summary
 RequestParameter bindsTo(Binding binding)
          Bind the values of this RequestParameter query to the given Binding.
 boolean evaluateHttp(HttpServletRewrite event, EvaluationContext context)
           
static RequestParameter exists(java.lang.String name)
          Return a RequestParameter condition that matches only against the existence of a parameter with the given name.
static RequestParameter existsMatching(java.lang.String nameRegex)
          Return a RequestParameter condition that matches only against the existence of a parameter with a name matching the given pattern.
static RequestParameter matches(java.lang.String nameRegex, java.lang.String valueRegex)
          Return a RequestParameter condition that matches against both parameter name and values.
static RequestParameter valueExists(java.lang.String valueRegex)
          Return a RequestParameter condition that matches only against the existence of a parameter with value matching the given pattern.
 
Methods inherited from class org.ocpsoft.rewrite.servlet.config.HttpCondition
evaluate
 
Methods inherited from class org.ocpsoft.rewrite.config.ConditionBuilder
and, andNot, or, orNot
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

bindsTo

public RequestParameter bindsTo(Binding binding)
Bind the values of this RequestParameter query to the given Binding.


matches

public static RequestParameter matches(java.lang.String nameRegex,
                                       java.lang.String valueRegex)
Return a RequestParameter condition that matches against both parameter name and values.

Matched parameter values may be bound. By default, matching values are bound to the EvaluationContext.

See also: bindsTo(Binding)

Parameters:
nameRegex - Regular expression matching the parameter name
valueRegex - Regular expression matching the parameter value

exists

public static RequestParameter exists(java.lang.String name)
Return a RequestParameter condition that matches only against the existence of a parameter with the given name. The parameter value is ignored.

Values of the matching parameter may be bound. By default, matching values are bound to the EvaluationContext.

See also: bindsTo(Binding)

Parameters:
name - The parameter name

existsMatching

public static RequestParameter existsMatching(java.lang.String nameRegex)
Return a RequestParameter condition that matches only against the existence of a parameter with a name matching the given pattern. The parameter value is ignored.

Values of matching parameters may be bound. By default, matching values are bound to the EvaluationContext.

See also: bindsTo(Binding)

Parameters:
nameRegex - Regular expression matching the parameter name

valueExists

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

Matching values may be bound. By default, matching values are bound to the EvaluationContext.

See also: bindsTo(Binding)

Parameters:
valueRegex - Regular expression matching the parameter value

evaluateHttp

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

rewrite-impl-servlet 1.0.2.Final

Copyright © 2012 OCPsoft. All Rights Reserved.