public final class ParameterDeserializer extends Object
For internal use only. May be renamed or removed in a future release.
Modifier and Type | Field and Description |
---|---|
static Set<Class<?>> |
supportedTypes
Types supported by
deserializeParameter(Class, String, String) . |
Modifier and Type | Method and Description |
---|---|
static <T> T |
deserializeParameter(Class<T> parameterType,
String parameter,
String targetClass)
Deserializer method for known parameter types.
|
static Object |
deserializeRouteParameters(Class<?> navigationTarget,
List<String> parameters)
Deserializes the list of url segments to an instance of the parameter
type.
|
static Class<?> |
getClassType(Class<?> navigationTarget)
Get the parameter type class.
|
static boolean |
isAnnotatedParameter(Class<?> navigationTarget,
Class<? extends Annotation> parameterAnnotation)
Check if the parameter value is annotated as OptionalParameter.
|
static void |
validateWildcardType(Class<?> navigationTarget,
Class<?> parameterType)
Validate that we can support the given wildcard parameter type.
|
static boolean |
verifyParameters(Class<?> navigationTarget,
List<String> parameters)
Verifies that the list of route parameters is valid for the given
navigation target.
|
public static final Set<Class<?>> supportedTypes
deserializeParameter(Class, String, String)
.public static <T> T deserializeParameter(Class<T> parameterType, String parameter, String targetClass)
T
- the type to deserialize intoparameterType
- class to deserialize parameter asparameter
- parameter to deserializetargetClass
- name of handled class for exception usagepublic static Object deserializeRouteParameters(Class<?> navigationTarget, List<String> parameters)
navigationTarget
- navigation target for which to deserialize parametersparameters
- the list of route parameters to deserializenull
public static void validateWildcardType(Class<?> navigationTarget, Class<?> parameterType)
navigationTarget
- navigation target classparameterType
- parameter type to check validity for usage with wildcardpublic static boolean verifyParameters(Class<?> navigationTarget, List<String> parameters)
navigationTarget
- the navigation target to verify againstparameters
- the list of route parameters to verifytrue
if the parameters are valid, otherwise false
public static Class<?> getClassType(Class<?> navigationTarget)
navigationTarget
- navigation target to get parameter type class forpublic static boolean isAnnotatedParameter(Class<?> navigationTarget, Class<? extends Annotation> parameterAnnotation)
navigationTarget
- navigation target to check for optionalparameterAnnotation
- annotation to check parameter forCopyright © 2021. All rights reserved.