rewrite-impl-servlet 1.0.3.Final

org.ocpsoft.rewrite.servlet.config
Class Path

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

public class Path
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 Path captureIn(java.lang.String param)
           
 boolean evaluateHttp(HttpServletRewrite event, EvaluationContext context)
           
 ParameterizedPattern getPathExpression()
          Get the underlying ParameterizedPattern for this Path
static Path 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)
           
 Path withRequestBinding()
          Bind each path 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 Path 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:

/example/{param}
/example/{value}/sub/{value2}
... and so on

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


captureIn

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

withRequestBinding

public Path withRequestBinding()
Bind each path 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 Path

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.