5.2. Available ValueSource annotations
Prev | 5. Working with externalized values | Next

## 5.2. Available `ValueSource` annotations

- `@PropertiesValueSource`
- `@EnvironmentValueSource`
- `@SystemPropertiesValueSource`

`ValueSource` annotations may be used in conjunction:

    @Configuration
    @EnvironmentValueSource
    @SystemPropertiesValueSource
    @PropertiesValueSource("classpath:com/acme/db.properties")
    public class AppConfig {
        @ExternalValue("datasource.username") String username;

        @Bean
        public TestBean testBean() {
            return new TestBean(username);
        }
    }

In this example, `datasource.username` will be looked for in `db.properties`, in the set of environment variables present at runtime and in the system properties.

| Note
Explicit ordering of `ValueSource` annotations is not yet supported but will be soon. See SJC-170 and SJC-171 for details.

Prev | Up | Next
5. Working with externalized values | Home | 6. Combining configuration styles