public class Router extends BaseRouter<Controller>
BaseRouter.Handler, BaseRouter.Routeglobals, routes, useAbsoluteUrl| Modifier | Constructor and Description |
|---|---|
|
Router(Globals globals) |
protected |
Router(Globals globals,
List<BaseRouter.Route> routes,
boolean useAbsoluteUrl)
Needed to support legacy API.
|
| Modifier and Type | Method and Description |
|---|---|
String |
buildUrlWithPrefix(String url,
Map<String,String> params,
boolean isResourceSupportCache,
boolean isResourceSupportCdn,
String hash,
String version)
Adds prefix to relative url.
|
Router |
cloneWithNewUrlMode(boolean useAbsoluteUrl)
Needed to support legacy API.
|
String |
contextBatchSourceMapUrl(String key,
String type,
Map<String,String> params,
boolean isResourceSupportCache,
boolean isResourceSupportCdn,
String resourceHash,
String resourceVersion) |
String |
contextBatchUrl(String key,
String type,
Map<String,String> params,
boolean isResourceSupportCache,
boolean isResourceSupportCdn,
String resourceHash,
String resourceVersion)
Url helpers.
|
protected Controller |
createController(Globals globals,
Request request,
Response response)
Override this method and provide instance of the controller.
|
static Tuple<Collection<String>,Collection<String>> |
decodeContexts(String encodedContexts)
Decodes context key like `batch1,batch2,-excludedBatch3,-excludedBatch4` into lists of included and excluded
contexts.
|
static Tuple<Collection<String>,LinkedHashSet<String>> |
decodeContextsAsWebResources(String encodedContexts)
Decodes list of Contexts Keys into Virtual Resources Keys.
|
static String |
encodeContexts(Collection<String> includedContexts,
Iterable<String> excludedContexts)
Encodes lists of included and excluded contexts into single key like `batch1,batch2,-excludedBatch3,
-excludedBatch4`.
|
static String |
escapeSlashes(String string) |
static boolean |
isSourceMap(Request request)
If the request is source map.
|
String |
pluginResourceUrl(String pluginKey,
String resourceName,
Map<String,String> params,
boolean isResourceSupportCache,
boolean isResourceSupportCdn,
String resourceHash,
String resourceVersion) |
String |
prebuildSourceUrl(Resource resource) |
String |
prebuildSourceUrl(String completeKey,
String resourceName,
Map<String,String> params,
boolean isResourceSupportCache,
boolean isResourceSupportCdn,
String resourceHash,
String resourceVersion) |
String |
resourceSourceMapUrl(String completeKey,
String resourceName,
Map<String,String> params,
boolean isResourceSupportCache,
boolean isResourceSupportCdn,
String resourceHash,
String resourceVersion) |
String |
resourceUrl(String completeKey,
String resourceName,
Map<String,String> params,
boolean isResourceSupportCache,
boolean isResourceSupportCdn,
String resourceHash,
String resourceVersion) |
static String |
resourceUrlAsStaticMethod(String completeKey,
String resourceName,
Map<String,String> params) |
String |
resourceUrlRelativeToContextBatch(String key,
String type,
String resourceName,
Map<String,String> params,
boolean isResourceSupportCache,
boolean isResourceSupportCdn,
String resourceHash,
String resourceVersion) |
String |
resourceUrlRelativeToWebResourceBatch(String completeKey,
String resourceName,
Map<String,String> params,
boolean isResourceSupportCache,
boolean isResourceSupportCdn,
String resourceHash,
String resourceVersion) |
String |
resourceUrlWithoutHash(Resource resource,
Map<String,String> params) |
String |
sourceMapUrl(String resourceUrl,
Map<String,String> generatedParams) |
static String |
sourceMapUrlToUrl(String sourceMapUrl)
Converting source map url to url, removes `.map` from url.
|
String |
sourceUrl(Resource resource) |
String |
sourceUrl(String completeKey,
String resourceName,
Map<String,String> params,
boolean isResourceSupportCache,
boolean isResourceSupportCdn,
String resourceHash,
String resourceVersion) |
protected static Collection<String> |
turnContextsIntoVirtualResources(Collection<String> contexts)
Decodes list of Contexts Keys into Virtual Resources Keys.
|
static String |
unescapeSlashes(String string) |
String |
webResourceBatchUrl(String completeKey,
String type,
Map<String,String> params,
boolean isResourceSupportCache,
boolean isResourceSupportCdn,
String resourceHash,
String resourceVersion)
It is important for the url structure to be: 1.
|
addRoute, buildUrl, buildUrl, callHandler, canDispatch, dispatch, interpolate, isUrlTooLong, joinWithSlashWithoutEmpty, parseWithRe, routeToRepublic Router(Globals globals)
protected Router(Globals globals, List<BaseRouter.Route> routes, boolean useAbsoluteUrl)
public String contextBatchUrl(String key, String type, Map<String,String> params, boolean isResourceSupportCache, boolean isResourceSupportCdn, String resourceHash, String resourceVersion)
public String contextBatchSourceMapUrl(String key, String type, Map<String,String> params, boolean isResourceSupportCache, boolean isResourceSupportCdn, String resourceHash, String resourceVersion)
public String resourceUrlRelativeToContextBatch(String key, String type, String resourceName, Map<String,String> params, boolean isResourceSupportCache, boolean isResourceSupportCdn, String resourceHash, String resourceVersion)
public static String resourceUrlAsStaticMethod(String completeKey, String resourceName, Map<String,String> params)
public String resourceUrl(String completeKey, String resourceName, Map<String,String> params, boolean isResourceSupportCache, boolean isResourceSupportCdn, String resourceHash, String resourceVersion)
public String resourceSourceMapUrl(String completeKey, String resourceName, Map<String,String> params, boolean isResourceSupportCache, boolean isResourceSupportCdn, String resourceHash, String resourceVersion)
public String pluginResourceUrl(String pluginKey, String resourceName, Map<String,String> params, boolean isResourceSupportCache, boolean isResourceSupportCdn, String resourceHash, String resourceVersion)
public String resourceUrlWithoutHash(Resource resource, Map<String,String> params)
public String sourceUrl(String completeKey, String resourceName, Map<String,String> params, boolean isResourceSupportCache, boolean isResourceSupportCdn, String resourceHash, String resourceVersion)
public String prebuildSourceUrl(String completeKey, String resourceName, Map<String,String> params, boolean isResourceSupportCache, boolean isResourceSupportCdn, String resourceHash, String resourceVersion)
public String webResourceBatchUrl(String completeKey, String type, Map<String,String> params, boolean isResourceSupportCache, boolean isResourceSupportCdn, String resourceHash, String resourceVersion)
public String resourceUrlRelativeToWebResourceBatch(String completeKey, String resourceName, Map<String,String> params, boolean isResourceSupportCache, boolean isResourceSupportCdn, String resourceHash, String resourceVersion)
public Router cloneWithNewUrlMode(boolean useAbsoluteUrl)
public String buildUrlWithPrefix(String url, Map<String,String> params, boolean isResourceSupportCache, boolean isResourceSupportCdn, String hash, String version)
public static String encodeContexts(Collection<String> includedContexts, Iterable<String> excludedContexts)
public static Tuple<Collection<String>,Collection<String>> decodeContexts(String encodedContexts)
public static Tuple<Collection<String>,LinkedHashSet<String>> decodeContextsAsWebResources(String encodedContexts)
protected static Collection<String> turnContextsIntoVirtualResources(Collection<String> contexts)
protected Controller createController(Globals globals, Request request, Response response)
BaseRoutercreateController in class BaseRouter<Controller>public static boolean isSourceMap(Request request)
public static String sourceMapUrlToUrl(String sourceMapUrl)
Copyright © 2019 Atlassian. All rights reserved.