rewrite-config-servlet 2.0.0.Beta3

org.ocpsoft.rewrite.servlet.config
Class Query

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.Query
All Implemented Interfaces:
Condition, ConditionBuilder, Parameterized

public abstract class Query
extends HttpCondition
implements Parameterized

A Condition that inspects the value of HttpServletRewrite#getRequestQueryString()

Author:
Lincoln Baxter, III

Constructor Summary
Query()
           
 
Method Summary
static Query matches(String query)
          Create a Condition matching the current Address.getQuery().
static Query parameterExists(String name)
          Create a Condition asserting the existence of specific parameter names within the current Address.getQuery()
static Query valueExists(String valuePattern)
          Create a Condition asserting the existence of specific parameter values within the current Address.getQuery().
 
Methods inherited from class org.ocpsoft.rewrite.servlet.config.HttpCondition
evaluate, evaluateHttp
 
Methods inherited from class org.ocpsoft.rewrite.config.DefaultConditionBuilder
and, andNot, or, orNot
 
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.param.Parameterized
getRequiredParameterNames, setParameterStore
 

Constructor Detail

Query

public Query()
Method Detail

matches

public static Query matches(String query)
Create a Condition matching the current Address.getQuery().

The given pattern may be parameterized:

?param=value
?param={param}
?param={param}&foo=bar
...

Parameters:
pattern - ParameterizedPattern matching the query string of the current Address.
See Also:
ConfigurationRuleParameterBuilder.where(String)

parameterExists

public static Query parameterExists(String name)
Create a Condition asserting the existence of specific parameter names within the current Address.getQuery()

The given parameter name is automatically parameterized:

Query.paramterExists("param")
...
Forward.to("/{param}/page.jsp")

Parameters:
pattern - name of the Parameter matching query parameter names within the current Address.getQuery().
See Also:
ConfigurationRuleParameterBuilder.where(String)

valueExists

public static Query valueExists(String valuePattern)
Create a Condition asserting the existence of specific parameter values within the current Address.getQuery().

Parameters:
pattern - ParameterizedPattern matching query parameter values of the current Address.getQuery().
See Also:
ConfigurationRuleParameterBuilder.where(String)

rewrite-config-servlet 2.0.0.Beta3

Copyright © 2013 OCPsoft. All Rights Reserved.