/** * Returns the default coding strategy given a mount path and class. * @param mountPath * @param pageClass * @return {@link BookmarkablePageRequestTargetUrlCodingStrategy} */ public IRequestTargetUrlCodingStrategy getDefaultStrategy(String mountPath, Class<? extends Page> pageClass) { return new BookmarkablePageRequestTargetUrlCodingStrategy(mountPath, pageClass, null); } }
public boolean matches(String path, boolean caseSensitive) { return defaultStrategy.matches(path, caseSensitive); }
@Override public IRequestTarget decode(RequestParameters requestParameters) { return defaultStrategy.decode(requestParameters); }
/** * Encodes the PageInfo part to the URL * * @param url * @param pageInfo * @return URL */ protected String addPageInfo(final String url, final PageInfo pageInfo) { if (pageInfo != null) { return url + getBeginSeparator() + pageInfo.toString() + getEndSeparator(); } else { return url; } }
@Override public String getMountPath() { return defaultStrategy.getMountPath(); }
/** * @see org.apache.wicket.request.IRequestCodingStrategy#pathForTarget(org.apache.wicket.IRequestTarget) */ public CharSequence pathForTarget(IRequestTarget requestTarget) { // first check whether the target was mounted IRequestTargetUrlCodingStrategy encoder = getMountEncoder(requestTarget); if (encoder != null) { return encoder.encode(requestTarget); } return null; }
/** * Mounts a shared resource class to the given path. * * @param path * the path to mount the resource class on * @param resourceKey * the shared key of the resource being mounted */ public final void mountSharedResource(final String path, final String resourceKey) { mount(new SharedResourceRequestTargetUrlCodingStrategy(path, resourceKey)); }
@Override protected String urlEncodePathComponent(String string) { String component = super.urlEncodePathComponent(string); if (component != null && component.contains(".")) { component = encodeDot(component); } return component; }
@Override protected String urlDecodePathComponent(String value) { String component = super.urlDecodePathComponent(value); if (component != null && component.contains("_-")) { component = decodeDot(component); } return component; }
/** * @param value * @return decoded value * * @deprecated Use urlEncodePathComponent or urlEncodeQueryComponent instead */ @Deprecated protected String urlDecode(String value) { return urlDecodePathComponent(value); }
/** * @param string * @return encoded value * * @deprecated Use urlEncodePathComponent or urlEncodeQueryComponent instead */ @Deprecated protected String urlEncode(String string) { return urlEncodePathComponent(string); }
private String decodeDot(String component) { for (int i = MAX_ESCAPE; i > 0; i--) { String seq = createEscapeSequence(i); if (component.contains(seq)) { component = component.replace(seq, "."); break; } } return component; }
/** * Encodes the PageInfo part to the URL * * @param url * @param pageInfo * @return */ protected String addPageInfo(String url, PageInfo pageInfo) { if (pageInfo != null) { return url + getBeginSeparator() + pageInfo.toString() + getEndSeparator(); } else { return url; } }
@Override public boolean matches(String path, boolean caseSensitive) { return defaultStrategy.matches(path, caseSensitive); }
public IRequestTarget decode(RequestParameters requestParameters) { return defaultStrategy.decode(requestParameters); }
public String getMountPath() { return defaultStrategy.getMountPath(); }
/** * Mounts a bookmarkable page class to the given path. * * @param path * the path to mount the bookmarkable page class on * @param bookmarkablePageClass * the bookmarkable page class to mount */ public final void mountBookmarkablePage(final String path, final Class bookmarkablePageClass) { mount(new BookmarkablePageRequestTargetUrlCodingStrategy(path, bookmarkablePageClass, null)); }
/** * Mounts a shared resource class to the given path. * * @param path * the path to mount the resource class on * @param resourceKey * the shared key of the resource being mounted */ public final void mountSharedResource(final String path, final String resourceKey) { mount(new SharedResourceRequestTargetUrlCodingStrategy(path, resourceKey)); }
@Override public boolean matches(IRequestTarget requestTarget) { return defaultStrategy.matches(requestTarget); }
public boolean matches(IRequestTarget requestTarget) { return defaultStrategy.matches(requestTarget); }