|
30 | 30 | import static com.fasterxml.jackson.annotation.JsonInclude.Include.NON_EMPTY;
|
31 | 31 |
|
32 | 32 | /**
|
33 |
| - * Intended to be identical to {@link ProblemDetailJacksonMixin} but for used |
34 |
| - * instead of it when jackson-dataformat-xml is on the classpath. Customizes the |
35 |
| - * XML root element name and adds namespace information. |
| 33 | + * Provides the same declarations as {@link ProblemDetailJacksonMixin}, and |
| 34 | + * some additional ones to support XML serialization when |
| 35 | + * jackson-dataformat-xml is on the classpath. Customizes the XML root element |
| 36 | + * name and adds namespace information. |
36 | 37 | *
|
37 |
| - * <p>Note: Unfortunately, we cannot just use {@code JsonRootName} to specify |
38 |
| - * the namespace since that is not inherited by fields of the class. This is |
39 |
| - * why we need a dedicated mixin for use when jackson-dataformat-xml is on the |
40 |
| - * classpath. For more details, see |
| 38 | + * <p>Note that we can't use {@code JsonRootName} to specify the namespace |
| 39 | + * since that is not inherited by fields of the class. This is why we need a |
| 40 | + * dedicated mixin for use when jackson-dataformat-xml is on the classpath. |
| 41 | + * For more details, see |
41 | 42 | * <a href="https://github.com/FasterXML/jackson-dataformat-xml/issues/355">FasterXML/jackson-dataformat-xml#355</a>.
|
42 | 43 | *
|
43 | 44 | * @author Rossen Stoyanchev
|
44 |
| - * @author Yanming Zhou |
45 | 45 | * @since 6.0.5
|
46 | 46 | */
|
47 | 47 | @JsonInclude(NON_EMPTY)
|
48 |
| -@JacksonXmlRootElement(localName = "problem", namespace = ProblemDetailJacksonXmlMixin.NAMESPACE) |
| 48 | +@JacksonXmlRootElement(localName = "problem", namespace = ProblemDetailJacksonXmlMixin.RFC_7807_NAMESPACE) |
49 | 49 | public interface ProblemDetailJacksonXmlMixin {
|
50 | 50 |
|
51 |
| - String NAMESPACE = "urn:ietf:rfc:7807"; |
| 51 | + /** RFC 7807 namespace. */ |
| 52 | + String RFC_7807_NAMESPACE = "urn:ietf:rfc:7807"; |
52 | 53 |
|
53 |
| - @JacksonXmlProperty(namespace = NAMESPACE) |
| 54 | + |
| 55 | + @JacksonXmlProperty(namespace = RFC_7807_NAMESPACE) |
54 | 56 | URI getType();
|
55 | 57 |
|
56 |
| - @JacksonXmlProperty(namespace = NAMESPACE) |
| 58 | + @JacksonXmlProperty(namespace = RFC_7807_NAMESPACE) |
57 | 59 | String getTitle();
|
58 | 60 |
|
59 |
| - @JacksonXmlProperty(namespace = NAMESPACE) |
| 61 | + @JacksonXmlProperty(namespace = RFC_7807_NAMESPACE) |
60 | 62 | int getStatus();
|
61 | 63 |
|
62 |
| - @JacksonXmlProperty(namespace = NAMESPACE) |
| 64 | + @JacksonXmlProperty(namespace = RFC_7807_NAMESPACE) |
63 | 65 | String getDetail();
|
64 | 66 |
|
65 |
| - @JacksonXmlProperty(namespace = NAMESPACE) |
| 67 | + @JacksonXmlProperty(namespace = RFC_7807_NAMESPACE) |
66 | 68 | URI getInstance();
|
67 | 69 |
|
68 | 70 | @JsonAnySetter
|
69 | 71 | void setProperty(String name, @Nullable Object value);
|
70 | 72 |
|
71 | 73 | @JsonAnyGetter
|
72 |
| - @JacksonXmlProperty(namespace = NAMESPACE) |
| 74 | + @JacksonXmlProperty(namespace = RFC_7807_NAMESPACE) |
73 | 75 | Map<String, Object> getProperties();
|
74 | 76 |
|
75 | 77 | }
|
0 commit comments