Browse Source

Define xml namespace as constant

See gh-29949
pull/29969/head
Yanming Zhou 2 years ago committed by rstoyanchev
parent
commit
55392dfbd7
  1. 17
      spring-web/src/main/java/org/springframework/http/converter/json/ProblemDetailJacksonXmlMixin.java

17
spring-web/src/main/java/org/springframework/http/converter/json/ProblemDetailJacksonXmlMixin.java

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

Loading…
Cancel
Save