@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", "dave@website.test", LocalDate.of(2000, 1, 28));
SDL.toSDL(p, System.out); // similar to using GSON: 'new GSON().toJson(obj, writer);'
Allow a pojo to convert to SDL using annotations:
and then write to sdl with: