org.apache.wicket.request.mapper
Class AbstractComponentMapper

java.lang.Object
  extended by org.apache.wicket.request.mapper.AbstractMapper
      extended by org.apache.wicket.request.mapper.AbstractComponentMapper
All Implemented Interfaces:
IRequestMapper
Direct Known Subclasses:
AbstractBookmarkableMapper, AbstractResourceReferenceMapper, CustomHomeMapper, LocaleFirstMapper, PageInstanceMapper

public abstract class AbstractComponentMapper
extends AbstractMapper
implements IRequestMapper

Convenience class for implementing page/components related encoders.

Author:
Matej Knopp

Constructor Summary
AbstractComponentMapper()
          Construct.
 
Method Summary
protected  void encodePageComponentInfo(Url url, PageComponentInfo info)
          Encodes the PageComponentInfo instance as the first query string parameter to the URL.
protected  IMapperContext getContext()
           
protected  java.lang.Class<? extends IRequestablePage> getPageClass(java.lang.String name)
          Loads page class with given name.
protected  PageComponentInfo getPageComponentInfo(Url url)
          Extracts the PageComponentInfo from the URL.
protected  void removeMetaParameter(Url urlCopy)
          The new IRequestMappers use the first query parameter to hold meta information about the request like page version, component version, locale, ...
protected  RequestListenerInterface requestListenerInterfaceFromString(java.lang.String interfaceName)
          Creates listener interface from the specified string
protected  java.lang.String requestListenerInterfaceToString(RequestListenerInterface listenerInterface)
          Converts the specified listener interface to String.
 
Methods inherited from class org.apache.wicket.request.mapper.AbstractMapper
encodePageParameters, extractPageParameters, getMountSegments, getOptionalPlaceholder, getPlaceholder, getPlaceholder, urlStartsWith
 
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.IRequestMapper
getCompatibilityScore, mapHandler, mapRequest
 

Constructor Detail

AbstractComponentMapper

public AbstractComponentMapper()
Construct.

Method Detail

getContext

protected IMapperContext getContext()

requestListenerInterfaceToString

protected java.lang.String requestListenerInterfaceToString(RequestListenerInterface listenerInterface)
Converts the specified listener interface to String.

Parameters:
listenerInterface -
Returns:
listenerInterface name as string

requestListenerInterfaceFromString

protected RequestListenerInterface requestListenerInterfaceFromString(java.lang.String interfaceName)
Creates listener interface from the specified string

Parameters:
interfaceName -
Returns:
listener interface

getPageComponentInfo

protected PageComponentInfo getPageComponentInfo(Url url)
Extracts the PageComponentInfo from the URL. The PageComponentInfo is encoded as the very first query parameter and the parameter consists of name only (no value).

Parameters:
url -
Returns:
PageComponentInfo instance if one was encoded in URL, null otherwise.

encodePageComponentInfo

protected void encodePageComponentInfo(Url url,
                                       PageComponentInfo info)
Encodes the PageComponentInfo instance as the first query string parameter to the URL.

Parameters:
url -
info -

getPageClass

protected java.lang.Class<? extends IRequestablePage> getPageClass(java.lang.String name)
Loads page class with given name.

Parameters:
name -
Returns:
class

removeMetaParameter

protected void removeMetaParameter(Url urlCopy)
The new IRequestMappers use the first query parameter to hold meta information about the request like page version, component version, locale, ... The actual IRequestMapper implementation can decide whether the this parameter should be removed before creating PageParameters from the current query parameters Removes the first query parameter only if PageComponentInfo.parse(String) returns non-null instance

Overrides:
removeMetaParameter in class AbstractMapper
Parameters:
urlCopy - the Url that first query parameter has no value


Copyright © 2006-2011 Apache Software Foundation. All Rights Reserved.