Class AbstractComponentMapper
- java.lang.Object
-
- org.apache.wicket.request.mapper.AbstractMapper
-
- org.apache.wicket.core.request.mapper.AbstractComponentMapper
-
- All Implemented Interfaces:
org.apache.wicket.request.IRequestMapper
- Direct Known Subclasses:
AbstractBookmarkableMapper
,AbstractResourceReferenceMapper
,PageInstanceMapper
public abstract class AbstractComponentMapper extends org.apache.wicket.request.mapper.AbstractMapper implements org.apache.wicket.request.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(org.apache.wicket.request.Url url, org.apache.wicket.request.mapper.info.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 org.apache.wicket.request.mapper.info.PageComponentInfo
getPageComponentInfo(org.apache.wicket.request.Url url)
Extracts thePageComponentInfo
from the URL.protected void
removeMetaParameter(org.apache.wicket.request.Url urlCopy)
Removes the first query parameter only ifPageComponentInfo.parse(String)
returns non-null instance-
Methods inherited from class org.apache.wicket.request.mapper.AbstractMapper
encodePageParameters, extractPageParameters, getMountSegments, getOptionalPlaceholder, getPlaceholder, getPlaceholder, resolveLocale, safeSegmentGetter, urlStartsWith
-
-
-
-
Constructor Detail
-
AbstractComponentMapper
public AbstractComponentMapper()
Construct.
-
-
Method Detail
-
getContext
protected IMapperContext getContext()
-
getPageComponentInfo
protected org.apache.wicket.request.mapper.info.PageComponentInfo getPageComponentInfo(org.apache.wicket.request.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(org.apache.wicket.request.Url url, org.apache.wicket.request.mapper.info.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(org.apache.wicket.request.Url urlCopy)
Removes the first query parameter only ifPageComponentInfo.parse(String)
returns non-null instance- Overrides:
removeMetaParameter
in classorg.apache.wicket.request.mapper.AbstractMapper
-
-