com.holonplatform.vaadin.flow.navigator.annotations

## Annotation Type QueryParameter

-     @Retention(value=RUNTIME)
       @Target(value=FIELD)
       @Documented
       @Inherited
      public @interface QueryParameter

  Annotation which can be used on a navigation target class field to inject the URL query parameter value which corresponds to the parameter name declared using the annotation `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.

  Since:
    5.2.0

- - ### Optional Element Summary

    Optional Elements
    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.

- - ### Element Detail

    - #### value

          public abstract String value

      The name of the URL query parameter which value has to be injected into the annotated navigation target class field.

      If the parameter name is blank or empty, the annotated field name will be used as parameter name.

      Returns:
        the parameter name, or empty to use the annotated field name
      Default:
        ""

  - - #### required

          public abstract boolean required

      Declares this parameter as required. If the parameter value is not available and no `defaultValue()` is defined, an error will be thrown.

      Default is `false`.

      Returns:
        `true` if parameter is required, `false` (default) otherwise
      Default:
        false

  - - #### defaultValue

          public abstract String defaultValue

      Get the default parameter value if no value is provided.

      According to the parameter value type, a suitable `String` representation must be provided for the default value:

      - For numeric values, the `.` (dot) character must be used as decimal separator.
      - For boolean values, only the words `true` and `false` are admitted.
      - For `Enum` type values, the enumeration `name` must be used as parameter value.
      - For temporal (date and time) type values, the ISO-8601 standard format must be used for the parameter value.
      Returns:
        the default parameter value, or an empty String for none
      Default:
        ""

Copyright © 2019 The Holon Platform. All rights reserved.