rewrite-config-servlet 2.0.0.Beta3

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

public class URL
extends HttpCondition
implements Parameterized

A Condition that inspects the entire value of the current Address.

Author:
Lincoln Baxter, III

Method Summary
static URL captureIn(String param)
          Create a Condition to capture the entire value of the current Address into the given Parameter name.
 boolean evaluateHttp(HttpServletRewrite event, EvaluationContext context)
           
 ParameterizedPatternParser getPathExpression()
           
 Set<String> getRequiredParameterNames()
           
 ParameterizedPatternParser getSchemeExpression()
          Get the underlying RegexParameterizedPatternBuilder for this URL
static URL matches(String pattern)
          Create a Condition that inspects the entire value of the current Address, comparing against the given pattern.
 void setParameterStore(ParameterStore store)
           
 String toString()
           
 URL withRequestBinding()
          Bind each Parameter value of the current Address 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 URL matches(String pattern)
Create a Condition that inspects the entire value of the current Address, comparing against the given pattern.

The given pattern may be parameterized:

INBOUND:
/path/store?item=1436 /path/store?item={itemId}
/path/{store}?item={itemId}&category={catId}
...

OUTBOUND:
http://domain.com/path/store.html?item=1436 http://domain.com/path/store?item={itemId}
/path/{store}?item={itemId}&category={catId}
...

Parameters:
url - ParameterizedPattern to which the current Address must match.
See Also:
ConfigurationRuleParameterBuilder#where(String)}

captureIn

public static URL captureIn(String param)
Create a Condition to capture the entire value of the current Address into the given Parameter name. This Parameter may be referenced in other Condition and Operation instances within the current Rule.

See Also:
ConfigurationRuleParameterBuilder.where(String)

withRequestBinding

public URL withRequestBinding()
Bind each Parameter value of the current Address to the corresponding request parameter by name. Only takes affect on InboundRewrite events.


evaluateHttp

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

getSchemeExpression

public ParameterizedPatternParser getSchemeExpression()
Get the underlying RegexParameterizedPatternBuilder for this URL

See also: #where(String)


toString

public String toString()
Overrides:
toString in class Object

getPathExpression

public ParameterizedPatternParser getPathExpression()

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.