File tree Expand file tree Collapse file tree 1 file changed +34
-0
lines changed
jsonb/src/main/java/io/avaje/jsonb Expand file tree Collapse file tree 1 file changed +34
-0
lines changed Original file line number Diff line number Diff line change 1010
1111/**
1212 * Marks a type for JSON support.
13+ *
14+ * <h3>Examples:</h3>
15+ *
16+ * <pre>{@code
17+ *
18+ * @Json(naming = LowerHyphen)
19+ * public class Customer ...
20+ *
21+ * }</pre>
22+ *
23+ * <pre>{@code
24+ *
25+ * @Json
26+ * public record Product( ... )
27+ *
28+ * }</pre>
1329 */
1430@ Retention (CLASS )
1531@ Target (ElementType .TYPE )
1632public @interface Json {
1733
1834 /**
1935 * Specify the naming convention to use for the properties on this type.
36+ * <p>
37+ * By default, the naming used is {@link Naming#Match}
2038 */
2139 Naming naming () default Naming .Match ;
2240
3351 * <p>
3452 * These types are typically in an external project / dependency or otherwise
3553 * types that we can't or don't want to explicitly annotate with {@code @Json}.
54+ * <p>
55+ * Typically, we put this annotation on a package.
56+ *
57+ * <pre>{@code
58+ *
59+ * @Json.Import({Customer.class, Product.class, ...})
60+ * package org.example.processor;
61+ *
62+ * }</pre>
3663 */
3764 @ Retention (CLASS )
3865 @ Target ({ElementType .TYPE , ElementType .PACKAGE })
4673
4774 /**
4875 * Override the json property name.
76+ *
77+ * <pre>{@code
78+ *
79+ * @Json.Property("$code")
80+ * String referenceCode;
81+ *
82+ * }</pre>
4983 */
5084 @ Retention (CLASS )
5185 @ Target ({ElementType .FIELD })
You can’t perform that action at this time.
0 commit comments