rewrite-impl-servlet 1.0.4.Final

org.ocpsoft.rewrite.servlet.config
Class Path

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.Path
All Implemented Interfaces:
Condition, ConditionBuilder, ConfigurationElement, Parameterized<IPath,IPath.PathParameter,String>, IPath

public class Path
extends HttpCondition
implements IPath

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

Author:
Lincoln Baxter, III

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.ocpsoft.rewrite.servlet.config.IPath
IPath.IPathParameter, IPath.PathParameter
 
Method Summary
static IPath captureIn(String param)
           
 boolean evaluateHttp(HttpServletRewrite event, EvaluationContext context)
           
 ParameterizedPattern getPathExpression()
          Get the underlying ParameterizedPattern for this Path
static IPath matches(String pattern)
          Inspect the current request URL, comparing against the given pattern.
 String toString()
           
 IPath.PathParameter where(String param)
           
 IPath.PathParameter where(String param, Binding binding)
           
 IPath 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.DefaultConditionBuilder
and, andNot, create, or, orNot, wrap
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, 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 IPath matches(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 IPath captureIn(String param)

withRequestBinding

public IPath 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)

Specified by:
withRequestBinding in interface IPath

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)

Specified by:
getPathExpression in interface IPath

toString

public String toString()
Overrides:
toString in class Object

where

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

where

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

rewrite-impl-servlet 1.0.4.Final

Copyright © 2012 OCPsoft. All Rights Reserved.