Class AbstractComponentMapper
- java.lang.Object
-
- org.apache.wicket.request.mapper.AbstractMapper
-
- 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
Constructors Constructor Description AbstractComponentMapper()
Construct.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected String
cleanClassName(String className)
Cleans the class name from any extra information that may be there.protected void
encodePageComponentInfo(Url url, PageComponentInfo info)
Encodes thePageComponentInfo
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 thePageComponentInfo
from the URL.protected void
removeMetaParameter(Url urlCopy)
The newIRequestMapper
s use the first query parameter to hold meta information about the request like page version, component version, locale, ...-
Methods inherited from class org.apache.wicket.request.mapper.AbstractMapper
encodePageParameters, extractPageParameters, getMountSegments, getOptionalPlaceholder, getPlaceholder, getPlaceholder, resolveLocale, safeSegmentGetter, 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()
-
getPageComponentInfo
protected PageComponentInfo getPageComponentInfo(Url url)
Extracts thePageComponentInfo
from the URL. ThePageComponentInfo
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 thePageComponentInfo
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
-
cleanClassName
protected String cleanClassName(String className)
Cleans the class name from any extra information that may be there.- Parameters:
className
- The raw class name parsed from the url- Returns:
- The cleaned class name
-
removeMetaParameter
protected void removeMetaParameter(Url urlCopy)
The newIRequestMapper
s use the first query parameter to hold meta information about the request like page version, component version, locale, ... The actualIRequestMapper
implementation can decide whether the this parameter should be removed before creatingPageParameters
from the currentquery parameters
Removes the first query parameter only ifPageComponentInfo.parse(String)
returns non-null instance- Overrides:
removeMetaParameter
in classAbstractMapper
- Parameters:
urlCopy
- theUrl
that first query parameter has no value
-
-