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 10
10
11
11
/**
12
12
* 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>
13
29
*/
14
30
@ Retention (CLASS )
15
31
@ Target (ElementType .TYPE )
16
32
public @interface Json {
17
33
18
34
/**
19
35
* Specify the naming convention to use for the properties on this type.
36
+ * <p>
37
+ * By default, the naming used is {@link Naming#Match}
20
38
*/
21
39
Naming naming () default Naming .Match ;
22
40
33
51
* <p>
34
52
* These types are typically in an external project / dependency or otherwise
35
53
* 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>
36
63
*/
37
64
@ Retention (CLASS )
38
65
@ Target ({ElementType .TYPE , ElementType .PACKAGE })
46
73
47
74
/**
48
75
* Override the json property name.
76
+ *
77
+ * <pre>{@code
78
+ *
79
+ * @Json.Property("$code")
80
+ * String referenceCode;
81
+ *
82
+ * }</pre>
49
83
*/
50
84
@ Retention (CLASS )
51
85
@ Target ({ElementType .FIELD })
You can’t perform that action at this time.
0 commit comments