@Retention(value=RUNTIME) @Target(value=FIELD) @Documented @Inherited public @interface QueryParameter
value().
The the parameter name (i.e. the annotation value()) is blank or empty, the annotated field name will be
used as parameter name.
This annotation supports a required() attribute to require a parameter value and the defaultValue()
attribute to provide a default parameter value when the value is not available from the navigation URL.
The default supported parameter value types are:
String.Number. The . (dot) character must be used as decimal separator for decimal numbers.Boolean. The true and false String values are admitted as parameter
values.Enum. The enumeration value name must be used as parameter value.Date. The ISO-8601 standard format must be used as parameter value representation.LocalDate. The ISO-8601 standard format must be used as parameter value representation.LocalTime. The ISO-8601 standard format must be used as parameter value representation.LocalDateTime. The ISO-8601 standard format must be used as parameter value representation.
The Set and List collection types are also supported as parameter value type, in order to obtain
multiple parameter values.
At last, the Optional type is supported as parameter value type.
One or more NavigationParameterTypeMapper can be registered using the Java ServiceLoader extensions
to provide support to further parameter value types.
| Modifier and Type | Optional Element and Description |
|---|---|
String |
defaultValue
Get the default parameter value if no value is provided.
|
boolean |
required
Declares this parameter as required.
|
String |
value
The name of the URL query parameter which value has to be injected into the annotated navigation target class
field.
|
public abstract String value
If the parameter name is blank or empty, the annotated field name will be used as parameter name.
public abstract boolean required
defaultValue() is
defined, an error will be thrown.
Default is false.
true if parameter is required, false (default) otherwisepublic abstract String defaultValue
According to the parameter value type, a suitable String representation must be provided for the default
value:
. (dot) character must be used as decimal separator.true and false are admitted.Enum type values, the enumeration name must be used as parameter value.Copyright © 2019 The Holon Platform. All rights reserved.