org.apache.wicket.core.request.mapper
Class AbstractComponentMapper

java.lang.Object
  extended by org.apache.wicket.request.mapper.AbstractMapper
      extended by org.apache.wicket.core.request.mapper.AbstractComponentMapper
All Implemented Interfaces:
IRequestMapper
Direct Known Subclasses:
AbstractBookmarkableMapper, AbstractResourceReferenceMapper, 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  Class<? extends IRequestablePage> getPageClass(String name)
          Loads page class with given name.
protected  PageComponentInfo getPageComponentInfo(Url url)
          Extracts the PageComponentInfo from the URL.
protected  void removeMetaParameter(Url urlCopy)
           Removes the first query parameter only if PageComponentInfo.parse(String) returns non-null instance
protected  RequestListenerInterface requestListenerInterfaceFromString(String interfaceName)
          Creates listener interface from the specified string
protected  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 String requestListenerInterfaceToString(RequestListenerInterface listenerInterface)
Converts the specified listener interface to String.

Parameters:
listenerInterface -
Returns:
listenerInterface name as string

requestListenerInterfaceFromString

protected RequestListenerInterface requestListenerInterfaceFromString(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 Class<? extends IRequestablePage> getPageClass(String name)
Loads page class with given name.

Parameters:
name -
Returns:
class

removeMetaParameter

protected void removeMetaParameter(Url urlCopy)
Removes the first query parameter only if PageComponentInfo.parse(String) returns non-null instance

Overrides:
removeMetaParameter in class AbstractMapper


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