Package com.xebialabs.deployit.spring
Class HoconPropertySourceFactory
java.lang.Object
com.xebialabs.deployit.spring.HoconPropertySourceFactory
- All Implemented Interfaces:
org.springframework.core.io.support.PropertySourceFactory
public class HoconPropertySourceFactory
extends Object
implements org.springframework.core.io.support.PropertySourceFactory
Make Hocon configuration files usable from spring context/wiring/autowiring.
Usage:
@literal @Configuration
@literal @EnableOAuth2Client
@literal @PropertySource(factory = HoconPropertySourceFactory.class, value = "auth-oidc.conf")
public class OpenIdConnectConfig {
@literal @Value("${xl.security.auth.providers.oidc.clientId}")
private String clientId;
...
}
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.core.env.PropertySource<?>createPropertySource(String name, org.springframework.core.io.support.EncodedResource resource) protected StringgetName(com.typesafe.config.Config config)
-
Constructor Details
-
HoconPropertySourceFactory
public HoconPropertySourceFactory()
-
-
Method Details
-
getName
-
createPropertySource
public org.springframework.core.env.PropertySource<?> createPropertySource(String name, org.springframework.core.io.support.EncodedResource resource) throws IOException - Specified by:
createPropertySourcein interfaceorg.springframework.core.io.support.PropertySourceFactory- Throws:
IOException
-