Annotation Interface ConfigMapping


@Documented @Target({FIELD,PARAMETER,TYPE}) @Retention(RUNTIME) public @interface ConfigMapping
This annotation may be placed in interfaces to group configuration properties with a common prefix.

Example

 @ConfigMapping(prefix = "server")
 public interface Server {
     public String host(); // maps the property name server.host

     public int port(); // maps to the property name server.port
 }
 
This annotation is also used in CDI aware environments to scan and register Config Mappings. Otherwise, Config Mapping interfaces require registration via SmallRyeConfigBuilder.withMapping(java.lang.Class).
See Also:
  • Element Details

    • prefix

      String prefix
      The prefix of the configuration properties.
      Returns:
      the configuration property prefix
      Default:
      ""
    • namingStrategy

      The naming strategy to use for the config mapping. This only matters for method names that contain both lower case and upper case characters.
      Returns:
      the config mapping naming strategy.
      Default:
      KEBAB_CASE
    • beanStyleGetters

      boolean beanStyleGetters
      Match config mapping method names and configuration properties using bean-style getter names. This removes the prefixes get or is and decapitalizes the next character. By default, bean-style getter matching is disabled.

      Config mapping declarations should prefer to use simple names that match one-to-one with their configuration names. Bean-style getter matching allows multiple method names to match the same configuration name. For instance, getFoo and isFoo both match foo, which may not be intended.

      Returns:
      a boolean true to enable bean style getter names matching, or false to disable it.
      Default:
      false