com.caucho.rewrite
Class AbstractRegexpDispatchRule

java.lang.Object
  extended by com.caucho.rewrite.AbstractDispatchRule
      extended by com.caucho.rewrite.AbstractRegexpDispatchRule
All Implemented Interfaces:
DispatchRule
Direct Known Subclasses:
AbstractTargetDispatchRule, Forward, Location

public abstract class AbstractRegexpDispatchRule
extends AbstractDispatchRule


Constructor Summary
AbstractRegexpDispatchRule()
           
 
Method Summary
 void add(Filter filter)
           
 void add(RequestPredicate predicate)
           
 void add(RewriteFilter filter)
           
protected  FilterChain createDispatch(DispatcherType type, java.lang.String uri, java.lang.String queryString, java.lang.String target, FilterChain next)
           
 java.util.regex.Pattern getRegexp()
           
 boolean isFilter()
           
 boolean isForward()
           
 boolean isInclude()
           
 boolean isRequest()
           
 FilterChain map(DispatcherType type, java.lang.String uri, java.lang.String queryString, FilterChain next, FilterChain tail)
          Creates a FilterChain for the action based on the uri and query string.
protected  java.lang.String rewriteTarget(java.util.regex.Matcher matcher, java.lang.String uri, java.lang.String queryString)
           
 java.lang.String rewriteUri(java.lang.String uri, java.lang.String queryString)
          Rewrites the URI for further processing.
 void setRegexp(java.util.regex.Pattern regexp)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AbstractRegexpDispatchRule

public AbstractRegexpDispatchRule()
Method Detail

setRegexp

public void setRegexp(java.util.regex.Pattern regexp)

getRegexp

public java.util.regex.Pattern getRegexp()

isRequest

public boolean isRequest()
Specified by:
isRequest in interface DispatchRule
Overrides:
isRequest in class AbstractDispatchRule

isInclude

public boolean isInclude()
Specified by:
isInclude in interface DispatchRule
Overrides:
isInclude in class AbstractDispatchRule

isForward

public boolean isForward()
Specified by:
isForward in interface DispatchRule
Overrides:
isForward in class AbstractDispatchRule

isFilter

public boolean isFilter()

add

public void add(RequestPredicate predicate)

add

public void add(RewriteFilter filter)

add

public void add(Filter filter)
         throws ServletException
Throws:
ServletException

rewriteUri

public java.lang.String rewriteUri(java.lang.String uri,
                                   java.lang.String queryString)
Description copied from interface: DispatchRule
Rewrites the URI for further processing. Rules following the current one will use the new URI.

Specified by:
rewriteUri in interface DispatchRule
Overrides:
rewriteUri in class AbstractDispatchRule

map

public FilterChain map(DispatcherType type,
                       java.lang.String uri,
                       java.lang.String queryString,
                       FilterChain next,
                       FilterChain tail)
                throws ServletException
Description copied from interface: DispatchRule
Creates a FilterChain for the action based on the uri and query string. Matching requests will use tail, and mismatching requests will use next. tail is the plain servlet/filter chain without any rewriting. next is the next rewrite dispatch

Specified by:
map in interface DispatchRule
Overrides:
map in class AbstractDispatchRule
uri - the request URI to match against
queryString - the request query string to match against
next - the next rewrite FilterChain dispatch
tail - the plain servlet/filter chain for a match
Throws:
ServletException

createDispatch

protected FilterChain createDispatch(DispatcherType type,
                                     java.lang.String uri,
                                     java.lang.String queryString,
                                     java.lang.String target,
                                     FilterChain next)

rewriteTarget

protected java.lang.String rewriteTarget(java.util.regex.Matcher matcher,
                                         java.lang.String uri,
                                         java.lang.String queryString)

toString

public java.lang.String toString()
Overrides:
toString in class AbstractDispatchRule