rewrite-impl-servlet 1.0.3.Final

org.ocpsoft.rewrite.servlet.config
Class URL

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.URL
All Implemented Interfaces:
Condition, Parameterized<ConditionParameterBuilder<RegexConditionParameterBuilder,java.lang.String>,java.lang.String>, ParameterizedCondition<ConditionParameterBuilder<RegexConditionParameterBuilder,java.lang.String>,java.lang.String>

public class URL
extends HttpCondition
implements ParameterizedCondition<ConditionParameterBuilder<RegexConditionParameterBuilder,java.lang.String>,java.lang.String>

A Condition that inspects the value of HttpServletRewrite.getRequestPath()

Author:
Lincoln Baxter, III

Method Summary
static URL captureIn(java.lang.String param)
           
 boolean evaluateHttp(HttpServletRewrite event, EvaluationContext context)
           
 ParameterizedPattern getPathExpression()
          Get the underlying ParameterizedPattern for this URL
static URL matches(java.lang.String pattern)
          Inspect the current request URL, comparing against the given pattern.
 java.lang.String toString()
           
 RegexConditionParameterBuilder where(java.lang.String param)
           
 RegexConditionParameterBuilder where(java.lang.String param, Binding binding)
           
 RegexConditionParameterBuilder where(java.lang.String param, java.lang.String pattern)
           
 RegexConditionParameterBuilder where(java.lang.String param, java.lang.String pattern, Binding binding)
           
 URL withRequestBinding()
          Bind each URL parameter to the corresponding request parameter by name.
 
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, wait, wait, wait
 
Methods inherited from interface org.ocpsoft.rewrite.param.ParameterizedCondition
and, andNot, or, orNot
 
Methods inherited from interface org.ocpsoft.rewrite.config.Condition
evaluate
 

Method Detail

matches

public static URL matches(java.lang.String pattern)
Inspect the current request URL, comparing against the given pattern.

The given pattern may be parameterized using the following format:

INBOUND:
/context-path/{param}?foo={bar}
/context-path/{param}/{param2}?foo={bar}&cab={caz}
... and so on
OUTBOUND:
http://domain.com/context-path/{param}?foo={bar}
/context-path/{param}/{param2}?foo={bar}&cab={caz}
... and so on

By default, matching parameter values are bound only to the EvaluationContext. See also where(String)


captureIn

public static URL captureIn(java.lang.String param)

withRequestBinding

public URL withRequestBinding()
Bind each URL parameter to the corresponding request parameter by name. By default, matching values are bound only to the EvaluationContext.

See also where(String)


where

public RegexConditionParameterBuilder where(java.lang.String param)
Specified by:
where in interface Parameterized<ConditionParameterBuilder<RegexConditionParameterBuilder,java.lang.String>,java.lang.String>

where

public RegexConditionParameterBuilder where(java.lang.String param,
                                            java.lang.String pattern)
Specified by:
where in interface Parameterized<ConditionParameterBuilder<RegexConditionParameterBuilder,java.lang.String>,java.lang.String>

where

public RegexConditionParameterBuilder where(java.lang.String param,
                                            java.lang.String pattern,
                                            Binding binding)
Specified by:
where in interface Parameterized<ConditionParameterBuilder<RegexConditionParameterBuilder,java.lang.String>,java.lang.String>

where

public RegexConditionParameterBuilder where(java.lang.String param,
                                            Binding binding)
Specified by:
where in interface Parameterized<ConditionParameterBuilder<RegexConditionParameterBuilder,java.lang.String>,java.lang.String>

evaluateHttp

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

getPathExpression

public ParameterizedPattern getPathExpression()
Get the underlying ParameterizedPattern for this URL

See also: where(String)


toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

rewrite-impl-servlet 1.0.3.Final

Copyright © 2012 OCPsoft. All Rights Reserved.