org.apache.wicket.request.mapper
Class AbstractMapper

java.lang.Object
  extended by org.apache.wicket.request.mapper.AbstractMapper
Direct Known Subclasses:
AbstractComponentMapper, MountMapper

public class AbstractMapper
extends java.lang.Object


Constructor Summary
AbstractMapper()
           
 
Method Summary
protected  Url encodePageParameters(Url url, PageParameters pageParameters, IPageParametersEncoder encoder)
          Encodes the given PageParameters to the URL using the given IPageParametersEncoder.
protected  PageParameters extractPageParameters(Request request, int segmentsToSkip, IPageParametersEncoder encoder)
          Extracts PageParameters from the URL using the given IPageParametersEncoder .
protected  java.lang.String[] getMountSegments(java.lang.String mountPath)
          Convenience method for representing mountPath as array of segments
protected static java.lang.String getPlaceholder(java.lang.String s)
          If the string is in a placeholder format ${key} this method returns the key.
protected  boolean urlStartsWith(Url url, java.lang.String... segments)
          Returns true if the given url starts with specified segments.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractMapper

public AbstractMapper()
Method Detail

getPlaceholder

protected static java.lang.String getPlaceholder(java.lang.String s)
If the string is in a placeholder format ${key} this method returns the key.

Parameters:
s -
Returns:
placeholder key or null if string is not in right format

urlStartsWith

protected boolean urlStartsWith(Url url,
                                java.lang.String... segments)
Returns true if the given url starts with specified segments. Segments that contain placelhoders are not compared.

Parameters:
url -
segments -
Returns:
true if the URL starts with the specified segments, false otherwise

extractPageParameters

protected PageParameters extractPageParameters(Request request,
                                               int segmentsToSkip,
                                               IPageParametersEncoder encoder)
Extracts PageParameters from the URL using the given IPageParametersEncoder .

Parameters:
request -
segmentsToSkip - how many URL segments should be skipped because they "belong" to the IRequestMapper
encoder -
Returns:
PageParameters instance

encodePageParameters

protected Url encodePageParameters(Url url,
                                   PageParameters pageParameters,
                                   IPageParametersEncoder encoder)
Encodes the given PageParameters to the URL using the given IPageParametersEncoder. The original URL object is unchanged.

Parameters:
url -
pageParameters -
encoder -
Returns:
URL with encoded parameters

getMountSegments

protected java.lang.String[] getMountSegments(java.lang.String mountPath)
Convenience method for representing mountPath as array of segments

Parameters:
mountPath -
Returns:
array of path segments


Copyright © 2004-2010 Apache Software Foundation. All Rights Reserved.