@Configuration
@PropertySource(value = "classpath:my-test.sdl", factory = SdlPropertySourceFactory.class)
public static class MySpringConfiguration {}
and then if the SDL file had a node such as author "Peter Parker" email="peter@example.org" active=true
the nodes value and attributes could be injected using:
@Value("${author}")
private String authorValue; // will result in "Peter Parker" being injected
@Value("${author|email}") // note that I may change this to "${author['email']}"
private String authorEmailAttr;
@Value("${author|active}") // note that I may change this to "${author['active']}"
private Boolean authorActiveAttr;
I've started a branch off of the annotation branch (as it requires multi-module project) which allows users to easily use SDL in Spring projects. https://github.com/sdlang-dev/SDL/tree/feature/spring
basic usage would be to set some config:
and then if the SDL file had a node such as
author "Peter Parker" email="peter@example.org" active=true
the nodes value and attributes could be injected using: