org.apache.wicket.request.target.coding
Class AbstractRequestTargetUrlCodingStrategy

java.lang.Object
  extended by org.apache.wicket.request.target.coding.AbstractRequestTargetUrlCodingStrategy
All Implemented Interfaces:
IMountableRequestTargetUrlCodingStrategy, IRequestTargetUrlCodingStrategy
Direct Known Subclasses:
BookmarkablePageRequestTargetUrlCodingStrategy, HybridUrlCodingStrategy, PackageRequestTargetUrlCodingStrategy, SharedResourceRequestTargetUrlCodingStrategy, URIRequestTargetUrlCodingStrategy

public abstract class AbstractRequestTargetUrlCodingStrategy
extends java.lang.Object
implements IRequestTargetUrlCodingStrategy, IMountableRequestTargetUrlCodingStrategy

Abstract class for mount encoders that uses paths and forward slashes.

Author:
Eelco Hillenius, Igor Vaynberg (ivaynberg)

Constructor Summary
AbstractRequestTargetUrlCodingStrategy(java.lang.String mountPath)
          Construct.
 
Method Summary
protected  void appendParameters(AppendingStringBuffer url, java.util.Map parameters)
          Encodes Map into a url fragment and append that to the provided url buffer.
protected  ValueMap decodeParameters(java.lang.String urlFragment, java.util.Map urlParameters)
          Decodes parameters object from the provided url fragment
 java.lang.String getMountPath()
          Returns the path of the url where this request target is mounted on.
 boolean matches(java.lang.String path)
          Returns true if this mounter is applicable for the URL path
protected  java.lang.String urlDecode(java.lang.String value)
          Returns a decoded value of the given value
protected  java.lang.String urlEncode(java.lang.String string)
          Url encodes a string
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.wicket.request.target.coding.IRequestTargetUrlCodingStrategy
decode, encode, matches
 

Constructor Detail

AbstractRequestTargetUrlCodingStrategy

public AbstractRequestTargetUrlCodingStrategy(java.lang.String mountPath)
Construct.

Parameters:
mountPath - the mount path
Method Detail

getMountPath

public final java.lang.String getMountPath()
Description copied from interface: IRequestTargetUrlCodingStrategy
Returns the path of the url where this request target is mounted on. This should not have a leading slash.

Specified by:
getMountPath in interface IMountableRequestTargetUrlCodingStrategy
Specified by:
getMountPath in interface IRequestTargetUrlCodingStrategy
Returns:
String The path of the url
See Also:
IMountableRequestTargetUrlCodingStrategy.getMountPath()

appendParameters

protected void appendParameters(AppendingStringBuffer url,
                                java.util.Map parameters)
Encodes Map into a url fragment and append that to the provided url buffer.

Parameters:
url - url so far
parameters - Map object to be encoded

decodeParameters

protected ValueMap decodeParameters(java.lang.String urlFragment,
                                    java.util.Map urlParameters)
Decodes parameters object from the provided url fragment

Parameters:
urlFragment - fragment of the url after the decoded path and before the query string
urlParameters - query string parameters
Returns:
Parameters created from the url fragment and query string

urlDecode

protected java.lang.String urlDecode(java.lang.String value)
Returns a decoded value of the given value

Parameters:
value -
Returns:
Decodes the value

urlEncode

protected java.lang.String urlEncode(java.lang.String string)
Url encodes a string

Parameters:
string - string to be encoded
Returns:
encoded string

matches

public boolean matches(java.lang.String path)
Description copied from interface: IRequestTargetUrlCodingStrategy
Returns true if this mounter is applicable for the URL path

Specified by:
matches in interface IRequestTargetUrlCodingStrategy
Returns:


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