public class HasUrlParameterFormat extends Object implements Serializable
HasUrlParameter
format into/from the template format.
For internal use only. May be renamed or removed in a future release.
Modifier and Type | Field and Description |
---|---|
static String |
PARAMETER
Reserved parameter placeholder used when setup internally route path
pattern with the parameter design for backward compatibility with
HasUrlParameter . |
static String |
PARAMETER_NAME
Reserved parameter name used when setup internally route path pattern
with the parameter design for backward compatibility with
HasUrlParameter . |
Modifier and Type | Method and Description |
---|---|
static void |
checkMandatoryParameter(Class<? extends Component> navigationTarget,
RouteParameters parameters)
Verify whether the navigationTarget has mandatory parameter and complies
with the given parameter values.
|
static String |
excludeTemplate(String urlTemplate,
Class<? extends Component> navigationTarget)
Gets the url base from a given url containing the url parameter template
placeholder
PARAMETER_NAME if it's
implementing HasUrlParameter . |
static <T> RouteParameters |
getParameters(List<T> parametersList)
Transform the
HasUrlParameter values into a
RouteParameters object. |
static <T> RouteParameters |
getParameters(T parameter)
Transform the
HasUrlParameter value into a
RouteParameters object. |
static List<Class<?>> |
getParameterTypes(Collection<String> types)
Gets the types of the parameters from string format.
|
static List<String> |
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 |
getUrl(String url,
List<T> parameters)
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 . |
static boolean |
hasUrlParameterTemplate(String url)
Verifies whether the given url already have the url parameter template or
not.
|
public static final String PARAMETER_NAME
HasUrlParameter
.public static final String PARAMETER
HasUrlParameter
.public static String getTemplate(String urlBase, Class<? extends Component> navigationTarget)
HasUrlParameter
urlBase
- url base.navigationTarget
- HasUrlParameter
navigation target.IllegalArgumentException
- if the given url base contains url parameter template.public static String excludeTemplate(String urlTemplate, Class<? extends Component> navigationTarget)
PARAMETER_NAME
if it's
implementing HasUrlParameter
.urlTemplate
- url with a parameter templatenavigationTarget
- HasUrlParameter
navigation target.IllegalArgumentException
- if the given url template doesn't contain url parameter
template.public static String getUrlBase(String template)
HasUrlParameter
.template
- the template.public static <T> String getUrl(String url, List<T> parameters)
T
- type of the values.url
- url base.parameters
- HasUrlParameter
parameter values.public static <T> RouteParameters getParameters(T parameter)
HasUrlParameter
value into a
RouteParameters
object.T
- type of the input value.parameter
- the parameter values.public static <T> RouteParameters getParameters(List<T> parametersList)
HasUrlParameter
values into a
RouteParameters
object.T
- type of the input values.parametersList
- the list of values.public static List<String> getParameterValues(RouteParameters parameters)
HasUrlParameter
from the specified route
parameters.parameters
- route parameter.public static List<Class<?>> getParameterTypes(Collection<String> types)
types
- the input string format types.public static void checkMandatoryParameter(Class<? extends Component> navigationTarget, RouteParameters parameters)
navigationTarget
- navigation target.parameters
- navigation route parameters.public static boolean hasUrlParameterTemplate(String url)
url
- url to be verifiedPARAMETER_NAME
Copyright © 2023. All rights reserved.