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 Details

    • HoconPropertySourceFactory

      public HoconPropertySourceFactory()
  • Method Details

    • getName

      protected String getName(com.typesafe.config.Config config)
    • createPropertySource

      public org.springframework.core.env.PropertySource<?> createPropertySource(String name, org.springframework.core.io.support.EncodedResource resource) throws IOException
      Specified by:
      createPropertySource in interface org.springframework.core.io.support.PropertySourceFactory
      Throws:
      IOException