rewrite-impl-servlet 1.0.5.Final

org.ocpsoft.rewrite.servlet.config
Class URL

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.URL
All Implemented Interfaces:
Condition, ConditionBuilder, ConfigurationElement, Parameterized<IURL,IURL.URLParameter,String>, IURL

public class URL
extends HttpCondition
implements IURL

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.IURL
IURL.IURLParameter, IURL.URLParameter
 
Method Summary
static URL captureIn(String param)
           
 boolean evaluateHttp(HttpServletRewrite event, EvaluationContext context)
           
 ParameterizedPattern getPathExpression()
           
 ParameterizedPattern getSchemeExpression()
          Get the underlying ParameterizedPattern for this URL
static URL matches(String pattern)
          Inspect the current request URL, comparing against the given pattern.
 String toString()
           
 IURL.URLParameter where(String param)
           
 IURL.URLParameter where(String param, 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.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 URL matches(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(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)

Specified by:
withRequestBinding in interface IURL

where

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

where

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

evaluateHttp

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

getSchemeExpression

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

See also: where(String)


toString

public String toString()
Overrides:
toString in class Object

getPathExpression

public ParameterizedPattern getPathExpression()
Specified by:
getPathExpression in interface IURL

rewrite-impl-servlet 1.0.5.Final

Copyright © 2012 OCPsoft. All Rights Reserved.