Define xml namespace as constant

See gh-29949
This commit is contained in:
Yanming Zhou 2023-02-09 10:48:27 +08:00 committed by rstoyanchev
parent ca9439657e
commit 55392dfbd7
1 changed files with 10 additions and 7 deletions

View File

@ -41,32 +41,35 @@ import static com.fasterxml.jackson.annotation.JsonInclude.Include.NON_EMPTY;
* <a href="https://github.com/FasterXML/jackson-dataformat-xml/issues/355">FasterXML/jackson-dataformat-xml#355</a>. * <a href="https://github.com/FasterXML/jackson-dataformat-xml/issues/355">FasterXML/jackson-dataformat-xml#355</a>.
* *
* @author Rossen Stoyanchev * @author Rossen Stoyanchev
* @author Yanming Zhou
* @since 6.0.5 * @since 6.0.5
*/ */
@JsonInclude(NON_EMPTY) @JsonInclude(NON_EMPTY)
@JacksonXmlRootElement(localName = "problem", namespace = "urn:ietf:rfc:7807") @JacksonXmlRootElement(localName = "problem", namespace = ProblemDetailJacksonXmlMixin.NAMESPACE)
public interface ProblemDetailJacksonXmlMixin { public interface ProblemDetailJacksonXmlMixin {
@JacksonXmlProperty(namespace = "urn:ietf:rfc:7807") String NAMESPACE = "urn:ietf:rfc:7807";
@JacksonXmlProperty(namespace = NAMESPACE)
URI getType(); URI getType();
@JacksonXmlProperty(namespace = "urn:ietf:rfc:7807") @JacksonXmlProperty(namespace = NAMESPACE)
String getTitle(); String getTitle();
@JacksonXmlProperty(namespace = "urn:ietf:rfc:7807") @JacksonXmlProperty(namespace = NAMESPACE)
int getStatus(); int getStatus();
@JacksonXmlProperty(namespace = "urn:ietf:rfc:7807") @JacksonXmlProperty(namespace = NAMESPACE)
String getDetail(); String getDetail();
@JacksonXmlProperty(namespace = "urn:ietf:rfc:7807") @JacksonXmlProperty(namespace = NAMESPACE)
URI getInstance(); URI getInstance();
@JsonAnySetter @JsonAnySetter
void setProperty(String name, @Nullable Object value); void setProperty(String name, @Nullable Object value);
@JsonAnyGetter @JsonAnyGetter
@JacksonXmlProperty(namespace = "urn:ietf:rfc:7807") @JacksonXmlProperty(namespace = NAMESPACE)
Map<String, Object> getProperties(); Map<String, Object> getProperties();
} }