From c21adf7f47ed0077c53547a36041b1dba45bdcb8 Mon Sep 17 00:00:00 2001 From: Reinier Zwitserloot Date: Thu, 2 Aug 2018 15:44:40 +0200 Subject: [website] added some ugly docs on how to interop jackson and builder. We need to make this prettier later and add the magic for how to interop Singular with Jackson later. --- website/templates/features/Builder.html | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'website/templates/features/Builder.html') diff --git a/website/templates/features/Builder.html b/website/templates/features/Builder.html index 4693d222..bc03749e 100644 --- a/website/templates/features/Builder.html +++ b/website/templates/features/Builder.html @@ -129,6 +129,27 @@

+ <@f.featureSection> +

With Jackson

+

+ You can customize parts of your builder, for example adding another method to the builder class, or annotating a method in the builder class, by making the builder class yourself. Lombok will generate everything that you do not manually add, and put it into this builder class. For example, if you are trying to configure jackson to use a specific subtype for a collection, you can write something like:

+@Value @Builder
+@JsonDeserialize(builder = JacksonExample.JacksonExampleBuilder.class)
+public class JacksonExample {
+	@Singular private List<Foo> foos;
+	
+	@JsonPOJOBuilder(withPrefix = "")
+	public static class JacksonExampleBuilder implements JacksonExampleBuilderMeta {
+	}
+	
+	private interface JacksonExampleBuilderMeta {
+		@JsonDeserialize(contentAs = FooImpl.class) JacksonExampleBuilder foos(List<? extends Foo> foos)
+	}
+}
+
+

+ + <@f.snippets name="Builder" /> <@f.confKeys> -- cgit