org.apache.tapestry5.internal.services
Class URLRewriterImpl

java.lang.Object
  extended by org.apache.tapestry5.internal.services.URLRewriterImpl
All Implemented Interfaces:
URLRewriter

@UsesOrderedConfiguration(value=URLRewriterRule.class)
public class URLRewriterImpl
extends Object
implements URLRewriter

Default URLRewriter implementation.

Since:
5.1.0.2

Constructor Summary
URLRewriterImpl(List<URLRewriterRule> rules)
          Single constructor of this class.
 
Method Summary
 boolean hasLinkRules()
           
 boolean hasRequestRules()
           
 org.apache.tapestry5.services.Request processLink(org.apache.tapestry5.services.Request request, URLRewriteContext context)
          Processes rules for rewriting links.
 org.apache.tapestry5.services.Request processRequest(org.apache.tapestry5.services.Request request)
          Processes an incoming Request.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

URLRewriterImpl

public URLRewriterImpl(List<URLRewriterRule> rules)
Single constructor of this class.

Parameters:
rules - a List of URLRewriterRule. It cannot be null.
Method Detail

processRequest

public org.apache.tapestry5.services.Request processRequest(org.apache.tapestry5.services.Request request)
Description copied from interface: URLRewriter
Processes an incoming Request. This method must check if they need to rewrite this request. If no, it must return the received request unchanged. This method cannot return null.

Specified by:
processRequest in interface URLRewriter
Parameters:
request - a Request.
Returns:
request a Request. It cannot be null.

processLink

public org.apache.tapestry5.services.Request processLink(org.apache.tapestry5.services.Request request,
                                                         URLRewriteContext context)
Description copied from interface: URLRewriter
Processes rules for rewriting links.

Specified by:
processLink in interface URLRewriter
Parameters:
request - the request to examine
context - the context providing additional information for rewriting
Returns:
the original request if the URLRewriter does nothing, a modified request otherwise, but never null

hasRequestRules

public boolean hasRequestRules()
Specified by:
hasRequestRules in interface URLRewriter
Returns:
true if the urlrewriter has any rules for rewriting inbound request urls

hasLinkRules

public boolean hasLinkRules()
Specified by:
hasLinkRules in interface URLRewriter
Returns:
true if the URLRewriter has any rules for rewriting outbound links.


Copyright © 2012. All Rights Reserved.