com.vaadin.flow.router.internal.
Class HasUrlParameterFormat
All Implemented Interfaces:
Utility methods to transform urls and parameters from/into the
HasUrlParameter
format into/from the template format.
For internal use only. May be renamed or removed in a future release.
See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
Reserved parameter placeholder used when setup internally route path pattern with the parameter design for backward compatibility with
HasUrlParameter
.static final String
Reserved parameter name used when setup internally route path pattern with the parameter design for backward compatibility with
HasUrlParameter
. -
Method Summary
Modifier and TypeMethodDescriptionstatic void
checkMandatoryParameter
(Class<? extends Component> navigationTarget, RouteParameters parameters) Verify whether the navigationTarget has mandatory parameter and complies with the given parameter values.
static <T> RouteParameters
getParameters
(List<T> parametersList) Transform the
HasUrlParameter
values into aRouteParameters
object.static <T> RouteParameters
getParameters
(T parameter) Transform the
HasUrlParameter
value into aRouteParameters
object.getParameterTypes
(Collection<String> types) Gets the types of the parameters from string format.
getParameterValues
(RouteParameters parameters) Gets the values for the
HasUrlParameter
from the specified route parameters.static String
getTemplate
(String urlBase, Class<? extends Component> navigationTarget) Gets the template for the given url base by appending the parameter according to the given navigationTarget if it's implementing
HasUrlParameter
static <T> String
Gets the final url by appending the given parameters.
static String
getUrlBase
(String template) Gets the url base without the parameter for the given template and navigation target implementing *
HasUrlParameter
.
-
Field Details
-
PARAMETER_NAME
Reserved parameter name used when setup internally route path pattern with the parameter design for backward compatibility with
HasUrlParameter
.See Also:
-
PARAMETER
Reserved parameter placeholder used when setup internally route path pattern with the parameter design for backward compatibility with
HasUrlParameter
.See Also:
-
-
Method Details
-
getTemplate
Gets the template for the given url base by appending the parameter according to the given navigationTarget if it's implementing
HasUrlParameter
Parameters:
urlBase
- url base.navigationTarget
-HasUrlParameter
navigation target.Returns:
the final template.
-
getUrlBase
Gets the url base without the parameter for the given template and navigation target implementing *
HasUrlParameter
.Parameters:
template
- the template.Returns:
the url base excluding the parameter placeholder.
-
getUrl
Gets the final url by appending the given parameters.
Type Parameters:
T
- type of the values.Parameters:
url
- url base.parameters
-HasUrlParameter
parameter values.Returns:
navigation url string.
-
getParameters
Transform the
HasUrlParameter
value into aRouteParameters
object.Type Parameters:
T
- type of the input value.Parameters:
parameter
- the parameter values.Returns:
RouteParameters instance wrapping the given parameter.
-
getParameters
Transform the
HasUrlParameter
values into aRouteParameters
object.Type Parameters:
T
- type of the input values.Parameters:
parametersList
- the list of values.Returns:
RouteParameters instance wrapping the given parameters.
-
getParameterValues
Gets the values for the
HasUrlParameter
from the specified route parameters.Parameters:
parameters
- route parameter.Returns:
HasUrlParameter compatible values.
-
getParameterTypes
Gets the types of the parameters from string format.
Parameters:
types
- the input string format types.Returns:
the class types of the parameters.
-
checkMandatoryParameter
public static void checkMandatoryParameter(Class<? extends Component> navigationTarget, RouteParameters parameters) Verify whether the navigationTarget has mandatory parameter and complies with the given parameter values.
Parameters:
navigationTarget
- navigation target.parameters
- navigation route parameters.
-