com.vaadin.shared.
Class VaadinUriResolver
- java.lang.Object
-
- com.vaadin.shared.VaadinUriResolver
-
All Implemented Interfaces:
Direct Known Subclasses:
public abstract class VaadinUriResolver extends Object implements Serializable
Utility for translating special Vaadin URIs like theme:// and app:// into URLs usable by the browser. This is an abstract class performing the main logic in
resolveVaadinUri(String)
and using abstract methods in the class for accessing information specific to the current environment.Since:
7.4
Author:
Vaadin Ltd
See Also:
-
-
Constructor Summary
Constructors Constructor Description VaadinUriResolver()
-
Method Summary
All Methods Modifier and Type Method Description protected abstract String
encodeQueryStringParameterValue(String parameterValue)
Encodes a value for safe inclusion as a parameter in the query string.
protected abstract String
getContextRootUrl()
Gets the URL pointing to the context root.
protected abstract String
getFrontendUrl()
Returns the URL pointing to the folder containing frontend files, either for ES5 (if browser does not support ES6) or ES6 (most browsers).
protected abstract String
getServiceUrl()
Gets the URL handled by
VaadinService
to handle application requests.protected abstract String
getServiceUrlParameterName()
Gets the name of the request parameter that should be used for sending the requested URL to the
service URL
.protected abstract String
getThemeUri()
Gets the URI of the directory of the current theme.
protected abstract String
getVaadinDirUrl()
Gets the URL pointing to the VAADIN directory.
String
resolveVaadinUri(String vaadinUri)
Translates a Vaadin URI to a URL that can be loaded by the browser.
-
-
-
Method Detail
-
resolveVaadinUri
public String resolveVaadinUri(String vaadinUri)
Translates a Vaadin URI to a URL that can be loaded by the browser. The following URI schemes are supported:
theme://
- resolves to the URL of the currently active theme.published://
- resolves to resources on the classpath published by@JavaScript
or@StyleSheet
annotations on connectors.app://
- resolves to a URL that will be routed to the currently registeredRequestHandler
instances.vaadin://
- resolves to the location of static resouces in the VAADIN directoryfrontend://
- resolves to the location of frontend (Bower and similar) resources, which might vary depending on the used browser
http://
orhttps://
are passed through this method unmodified.Parameters:
vaadinUri
- the uri to resolveReturns:
the resolved uri
Since:
7.4
-
getVaadinDirUrl
protected abstract String getVaadinDirUrl()
Gets the URL pointing to the VAADIN directory.
Returns:
the VAADIN directory URL
-
getServiceUrlParameterName
protected abstract String getServiceUrlParameterName()
Gets the name of the request parameter that should be used for sending the requested URL to the
service URL
. Ifnull
is returned, the requested URL will instead be appended to the base service URL.Returns:
the parameter name used for passing request URLs, or
null
to send the path as a part of the request path.
-
getServiceUrl
protected abstract String getServiceUrl()
Gets the URL handled by
VaadinService
to handle application requests.Returns:
the service URL
-
getContextRootUrl
protected abstract String getContextRootUrl()
Gets the URL pointing to the context root.
Returns:
the context root URL
Since:
8.0.3
-
getThemeUri
protected abstract String getThemeUri()
Gets the URI of the directory of the current theme.
Returns:
the URI of the current theme directory
-
encodeQueryStringParameterValue
protected abstract String encodeQueryStringParameterValue(String parameterValue)
Encodes a value for safe inclusion as a parameter in the query string.
Parameters:
parameterValue
- the value to encodeReturns:
the encoded value
-
getFrontendUrl
protected abstract String getFrontendUrl()
Returns the URL pointing to the folder containing frontend files, either for ES5 (if browser does not support ES6) or ES6 (most browsers).
Returns:
the absolute or relative URL to the frontend files, ending with a slash '/'
Since:
8.1
-
-