Skip to content

SDLang as a PropertySource for Spring Framework #62

Open
@SingingBush

Description

@SingingBush

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:

    @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="[email protected]" 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;

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions