Package io.smallrye.config
Annotation Type 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 viaSmallRyeConfigBuilder.withMapping(java.lang.Class, java.lang.String).
-
-
Optional Element Summary
Optional Elements Modifier and Type Optional Element Description ConfigMapping.NamingStrategynamingStrategyThe naming strategy to use for the config mapping.StringprefixThe prefix of the configuration properties.
-
-
-
Element Detail
-
prefix
String prefix
The prefix of the configuration properties.- Returns:
- the configuration property prefix
- Default:
- ""
-
-
-
namingStrategy
ConfigMapping.NamingStrategy 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:
- io.smallrye.config.ConfigMapping.NamingStrategy.KEBAB_CASE
-
-