| 1 | --- |
| 2 | layout: docs |
| 3 | title: Disabling features |
| 4 | prev_section: debugging |
| 5 | next_section: configuring |
| 6 | permalink: /docs/disabling-features/ |
| 7 | --- |
| 8 | |
| 9 | If for some reasons some feature is causing some problems it is possible, for |
| 10 | some of them, to be disabled. For instance, if you are implementing the variable |
| 11 | expansion by yourself, you may want to disable the variable expansion provided |
| 12 | by OWNER. |
| 13 | |
| 14 | |
| 15 | This can be done using the [`@DisabledFeature`][df] annotation. |
| 16 | |
| 17 | The `@DisabledFeature` can also be combined with multiple |
| 18 | [`DisableableFeature`][dfe] and it can be used on method level or on class level: |
| 19 | |
| 20 | ```java |
| 21 | // on class level... |
| 22 | @DisableFeature({VARIABLE_EXPANSION, PARAMETER_FORMATTING}) |
| 23 | public interface SampleConfig extends Config { |
| 24 | @DefaultValue("Earth") |
| 25 | public String planet(); |
| 26 | |
| 27 | // on method level... |
| 28 | @DisableFeature({VARIABLE_EXPANSION, PARAMETER_FORMATTING}) |
| 29 | @DefaultValue("Hello %s, welcome on ${planet}!") |
| 30 | public String hello(String name); |
| 31 | } |
| 32 | ``` |
| 33 | |
| 34 | In the above example the method `String hello(String name)` will return the |
| 35 | String "Hello %s, welcome on ${planet}!", ignoring the parameter passed. |
| 36 | |
| 37 | [dfe]: http://owner.aeonbits.org/apidocs/latest/org/aeonbits/owner/Config.DisableableFeature.html |
| 38 | [df]: http://owner.aeonbits.org/apidocs/latest/org/aeonbits/owner/Config.DisableFeature.html |