Package org.openl.spring.env
Class ApplicationPropertySource
- java.lang.Object
-
- org.springframework.core.env.PropertySource<T>
-
- org.springframework.core.env.EnumerablePropertySource<Deque<org.springframework.core.env.PropertySource<?>>>
-
- org.openl.spring.env.ApplicationPropertySource
-
public class ApplicationPropertySource extends org.springframework.core.env.EnumerablePropertySource<Deque<org.springframework.core.env.PropertySource<?>>>
Application properties can be get as combinations of locations and names. If a location is a folder then it is concatenated with each name. For example:application name (from the Spring application context): WebStudio
Spring active profiles: prod, qa
locations: file:, file:openl.properties, file:openl/
names: application.properties, {appName}.properties, {profile}.properties
Then the list of resources to search is (next resource overides previous):- file:application.properties
- file:WebStudio.properties
- file:prod.properties
- file:qa.properties
- file:openl.properties
- file:openl/application.properties
- file:openl/WebStudio.properties
- file:openl/prod.properties
- file:openl/qa.properties
Default Application externalized configuration:
Can be overridden usingopenl.config.nameorspring.config.nameproperties for names.
Andopenl.config.locationorspring.config.locationproperties for folders and locations.- classpath:application*-default.properties
- classpath:application.properties
- classpath:{appName}.properties
- classpath:config/application.properties
- classpath:config/{appName}.properties
- file:application.properties
- file:{appName}.properties
- file:conf/application.properties
- file:conf/{appName}.properties
- file:config/application.properties
- file:config/{appName}.properties
- file:${user.home}/application.properties
- file:${user.home}/{appName}.properties
- classpath:application-{profile}.properties
- classpath:{appName}-{profile}.properties
- classpath:config/application-{profile}.properties
- classpath:config/{appName}-{profile}.properties
- file:application-{profile}.properties
- file:{appName}-{profile}.properties
- file:conf/application-{profile}.properties
- file:config/application-{profile}.properties
- file:conf/{appName}-{profile}.properties
- file:config/{appName}-{profile}.properties
- file:${user.home}/application-{profile}.properties
- file:${user.home}/{appName}-{profile}.properties
- Author:
- Yury Molchan
- See Also:
- Spring Boot. Externalized Configuration.
-
-
Field Summary
Fields Modifier and Type Field Description static StringPROPS_NAME
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancontainsProperty(String name)ObjectgetProperty(String name)String[]getPropertyNames()
-
-
-
Field Detail
-
PROPS_NAME
public static final String PROPS_NAME
- See Also:
- Constant Field Values
-
-
Method Detail
-
getProperty
public Object getProperty(String name)
- Specified by:
getPropertyin classorg.springframework.core.env.PropertySource<Deque<org.springframework.core.env.PropertySource<?>>>
-
containsProperty
public boolean containsProperty(String name)
- Overrides:
containsPropertyin classorg.springframework.core.env.EnumerablePropertySource<Deque<org.springframework.core.env.PropertySource<?>>>
-
-