rewrite-config-servlet 2.0.0.Beta3

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, Parameterized

public class Path
extends HttpCondition
implements Parameterized

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

Author:
Lincoln Baxter, III

Method Summary
static Path captureIn(String param)
          Capture the entire path portion of the Address into the given Parameter.
 boolean evaluateHttp(HttpServletRewrite event, EvaluationContext context)
           
 ParameterizedPatternParser getExpression()
          Get the underlying ParameterizedPattern for this Path
 Set<String> getRequiredParameterNames()
           
static Path matches(String pattern)
          Create a Condition that compares the current Address.getPath() to the given pattern.
 void setParameterStore(ParameterStore store)
           
 String toString()
           
 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.DefaultConditionBuilder
and, andNot, or, orNot
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

matches

public static Path matches(String pattern)
Create a Condition that compares the current Address.getPath() to the given pattern.

The given pattern may be parameterized:

/example/{param}
/example/{param1}/sub/{param2}
...

Parameters:
pattern - ParameterizedPattern matching the path.
See Also:
ConfigurationRuleParameterBuilder.where(String)

captureIn

public static Path captureIn(String param)
Capture the entire path portion of the Address into the given Parameter.

Parameters:
param - the name of the Parameter to which the entire path portion of the Address will be bound.

withRequestBinding

public Path withRequestBinding()
Bind each path Parameter to the corresponding request parameter by name.

See Also:
ConfigurationRuleParameterBuilder#where(String)} {@link HttpServletRequest#getParameterMap()} {@link RequestParameterProvider}

evaluateHttp

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

getExpression

public ParameterizedPatternParser getExpression()
Get the underlying ParameterizedPattern for this Path


toString

public String toString()
Overrides:
toString in class Object

getRequiredParameterNames

public Set<String> getRequiredParameterNames()
Specified by:
getRequiredParameterNames in interface Parameterized

setParameterStore

public void setParameterStore(ParameterStore store)
Specified by:
setParameterStore in interface Parameterized

rewrite-config-servlet 2.0.0.Beta3

Copyright © 2013 OCPsoft. All Rights Reserved.