Package io.jmix.flowui.view.navigation
Class RouteSupport
java.lang.Object
io.jmix.flowui.view.navigation.RouteSupport
Utility bean that facilitates url modifications and generations.
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprotected javax.servlet.ServletContextprotected UrlParamSerializer
- 
Constructor SummaryConstructorsConstructorDescriptionRouteSupport(UrlParamSerializer urlParamSerializer, javax.servlet.ServletContext servletContext) 
- 
Method SummaryModifier and TypeMethodDescriptionvoidaddQueryParameter(com.vaadin.flow.component.UI ui, String name, Object value) Updates the current url by adding the value of the given query parameter.voidaddQueryParameter(com.vaadin.flow.component.UI ui, String name, List<Object> values) Updates the current url by adding the value of the given query parameter.com.vaadin.flow.router.QueryParametersaddQueryParameter(com.vaadin.flow.router.QueryParameters queryParameters, String name, Object value) Creates a newQueryParametersobject by adding to it the value of the given query parameter.com.vaadin.flow.router.QueryParametersaddQueryParameter(com.vaadin.flow.router.QueryParameters queryParameters, String name, List<Object> values) Creates a newQueryParametersobject by adding to it the value of the given query parameter.convertValues(List<Object> values) com.vaadin.flow.router.RouteParameterscreateRouteParameters(String param, Object value) CreatesRouteParametersobject which stores a single route parameter with given name and value.voidfetchCurrentLocation(com.vaadin.flow.component.UI ui, Consumer<com.vaadin.flow.router.Location> callback) Retrieves the current url from the browser and converts it to theLocationobject.com.vaadin.flow.router.QueryParametersmergeQueryParameters(com.vaadin.flow.router.QueryParameters... parameters) Creates a newQueryParametersobject by merging passed query parameters into one.resolveLocationString(URL url) Creates a string containing a relative URL excluding query parameters.com.vaadin.flow.router.QueryParametersresolveQueryParameters(String queryString) CreatesQueryParametersobject from a query string.com.vaadin.flow.router.QueryParametersCreatesQueryParametersobject from the query part of the givenURLobject.voidsetQueryParameter(com.vaadin.flow.component.UI ui, String name, Object value) Updates the current url by setting the value of the given query parameter.voidsetQueryParameter(com.vaadin.flow.component.UI ui, String name, List<Object> values) Updates the current url by setting the value of the given query parameter.com.vaadin.flow.router.QueryParameterssetQueryParameter(com.vaadin.flow.router.QueryParameters queryParameters, String name, Object value) Creates a newQueryParametersobject by setting to it the value of the given query parameter.com.vaadin.flow.router.QueryParameterssetQueryParameter(com.vaadin.flow.router.QueryParameters queryParameters, String name, List<Object> values) Creates a newQueryParametersobject by setting to it the value of the given query parameter.voidsetQueryParameters(com.vaadin.flow.component.UI ui, com.vaadin.flow.router.QueryParameters queryParameters) Overrides the current url query parameters with the values represented byQueryParametersobject.protected voidupdateQueryParameters(com.vaadin.flow.component.UI ui, String name, List<Object> values, org.apache.commons.lang3.function.TriFunction<com.vaadin.flow.router.QueryParameters, String, List<Object>, com.vaadin.flow.router.QueryParameters> updater) 
- 
Field Details- 
urlParamSerializer
- 
servletContextprotected javax.servlet.ServletContext servletContext
 
- 
- 
Constructor Details
- 
Method Details- 
fetchCurrentLocationpublic void fetchCurrentLocation(com.vaadin.flow.component.UI ui, Consumer<com.vaadin.flow.router.Location> callback) Retrieves the current url from the browser and converts it to theLocationobject. The URL is fetched from the browser in another request asynchronously and theLocationobject passed to the callback.- Parameters:
- ui- UI instance for which to fetch current location
- callback- to be notified when the location is resolved
 
- 
addQueryParameterUpdates the current url by adding the value of the given query parameter. If a query parameter with the same name already exists, the new value is added excluding duplicates, otherwise the query parameter is added.- Parameters:
- ui- UI instance for which to update url
- name- the query parameter name
- value- the query parameter value
 
- 
addQueryParameterUpdates the current url by adding the value of the given query parameter. If a query parameter with the same name already exists, the new value is added excluding duplicates, otherwise the query parameter is added.- Parameters:
- ui- UI instance for which to update url
- name- the query parameter name
- values- the query parameter values
 
- 
setQueryParameterUpdates the current url by setting the value of the given query parameter. If a query parameter with the same name already exists, its value is overridden, otherwise the query parameter is added.- Parameters:
- ui- UI instance for which to update url
- name- the query parameter name
- value- the query parameter value
 
- 
setQueryParameterUpdates the current url by setting the value of the given query parameter. If a query parameter with the same name already exists, its value is overridden, otherwise the query parameter is added.- Parameters:
- ui- UI instance for which to update url
- name- the query parameter name
- values- the query parameter values
 
- 
updateQueryParameters
- 
setQueryParameterspublic void setQueryParameters(com.vaadin.flow.component.UI ui, com.vaadin.flow.router.QueryParameters queryParameters) Overrides the current url query parameters with the values represented byQueryParametersobject.- Parameters:
- ui- UI instance for which to update url
- queryParameters- an object which holds query parameters information
 
- 
createRouteParametersCreatesRouteParametersobject which stores a single route parameter with given name and value.- Parameters:
- param- the route parameter name
- value- the route parameter value
- Returns:
- an object which stores the route parameters
 
- 
mergeQueryParameterspublic com.vaadin.flow.router.QueryParameters mergeQueryParameters(com.vaadin.flow.router.QueryParameters... parameters) Creates a newQueryParametersobject by merging passed query parameters into one. If several objects have the same query parameter information, the latest have precedence.- Parameters:
- parameters- query parameters to merge
- Returns:
- a new QueryParametersobject which holds query parameters information.
 
- 
addQueryParameterpublic com.vaadin.flow.router.QueryParameters addQueryParameter(com.vaadin.flow.router.QueryParameters queryParameters, String name, Object value) Creates a newQueryParametersobject by adding to it the value of the given query parameter. If a query parameter with the same name already exists, the new value is added excluding duplicates, otherwise the query parameter is added.- Parameters:
- queryParameters- the- QueryParametersobject to update
- name- the query parameter name
- value- the query parameter value
- Returns:
- a new QueryParametersobject which holds query parameters information.
 
- 
addQueryParameterpublic com.vaadin.flow.router.QueryParameters addQueryParameter(com.vaadin.flow.router.QueryParameters queryParameters, String name, List<Object> values) Creates a newQueryParametersobject by adding to it the value of the given query parameter. If a query parameter with the same name already exists, the new value is added excluding duplicates, otherwise the query parameter is added.- Parameters:
- queryParameters- the- QueryParametersobject to update
- name- the query parameter name
- values- the query parameter values
- Returns:
- a new QueryParametersobject which holds query parameters information.
 
- 
setQueryParameterpublic com.vaadin.flow.router.QueryParameters setQueryParameter(com.vaadin.flow.router.QueryParameters queryParameters, String name, Object value) Creates a newQueryParametersobject by setting to it the value of the given query parameter. If a query parameter with the same name already exists, its value is overridden, otherwise the query parameter is added.- Parameters:
- queryParameters- the- QueryParametersobject to update
- name- the query parameter name
- value- the query parameter value
- Returns:
- a new QueryParametersobject which holds query parameters information.
 
- 
setQueryParameterpublic com.vaadin.flow.router.QueryParameters setQueryParameter(com.vaadin.flow.router.QueryParameters queryParameters, String name, List<Object> values) Creates a newQueryParametersobject by setting to it the value of the given query parameter. If a query parameter with the same name already exists, its value is overridden, otherwise the query parameter is added.- Parameters:
- queryParameters- the- QueryParametersobject to update
- name- the query parameter name
- values- the query parameter values
- Returns:
- a new QueryParametersobject which holds query parameters information.
 
- 
resolveLocationStringCreates a string containing a relative URL excluding query parameters.- Parameters:
- url- a- URLobject to obtain location
- Returns:
- a string representing a relative URL excluding query parameters.
 
- 
resolveQueryParametersCreatesQueryParametersobject from the query part of the givenURLobject.- Parameters:
- url- a- URLobject to obtain query parameters
- Returns:
- a QueryParametersobject which holds query parameters information.
 
- 
resolveQueryParametersCreatesQueryParametersobject from a query string.- Parameters:
- queryString- a string to parse
- Returns:
- a QueryParametersobject which holds query parameters information.
 
- 
convertValues
 
-