Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sdl-annotations #9

Open
SingingBush opened this issue Feb 15, 2020 · 2 comments
Open

sdl-annotations #9

SingingBush opened this issue Feb 15, 2020 · 2 comments
Assignees
Milestone

Comments

@SingingBush
Copy link
Member

SingingBush commented Feb 15, 2020

Allow a pojo to convert to SDL using annotations:

    @Tag("person")
    public static class Person {

        @Value
        private String username;

        @Attribute
        private String email;

        @Attribute("dob")
        private LocalDate dob;

        public Person(String username, String email, LocalDate dob) {
            this.username = username;
            this.email = email;
            this.dob = dob;
        }

        public String getEmail() {
            return email;
        }

        public LocalDate getDob() {
            return dob;
        }
    }

and then write to sdl with:

final Person p = new Person("testing", "[email protected]", LocalDate.of(2000, 1, 28));

SDL.toSDL(p, System.out); // similar to using GSON: 'new GSON().toJson(obj, writer);'
@SingingBush SingingBush added this to the 2.2.0 milestone Feb 15, 2020
@SingingBush SingingBush self-assigned this Feb 15, 2020
SingingBush added a commit that referenced this issue Feb 15, 2020
SingingBush added a commit that referenced this issue Dec 19, 2023
SingingBush added a commit that referenced this issue Jan 5, 2024
@SingingBush
Copy link
Member Author

this is now in develop branch so will be a part of future releases

@SingingBush SingingBush modified the milestones: 2.2.0, 2.3.0 Jan 5, 2024
@SingingBush
Copy link
Member Author

needs some further changes which are being worked on now in the comment-style branch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant