parent
55392dfbd7
commit
27fdf56ed5
|
|
@ -30,46 +30,48 @@ import org.springframework.lang.Nullable;
|
||||||
import static com.fasterxml.jackson.annotation.JsonInclude.Include.NON_EMPTY;
|
import static com.fasterxml.jackson.annotation.JsonInclude.Include.NON_EMPTY;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Intended to be identical to {@link ProblemDetailJacksonMixin} but for used
|
* Provides the same declarations as {@link ProblemDetailJacksonMixin}, and
|
||||||
* instead of it when jackson-dataformat-xml is on the classpath. Customizes the
|
* some additional ones to support XML serialization when
|
||||||
* XML root element name and adds namespace information.
|
* jackson-dataformat-xml is on the classpath. Customizes the XML root element
|
||||||
|
* name and adds namespace information.
|
||||||
*
|
*
|
||||||
* <p>Note: Unfortunately, we cannot just use {@code JsonRootName} to specify
|
* <p>Note that we can't use {@code JsonRootName} to specify the namespace
|
||||||
* the namespace since that is not inherited by fields of the class. This is
|
* since that is not inherited by fields of the class. This is why we need a
|
||||||
* why we need a dedicated mixin for use when jackson-dataformat-xml is on the
|
* dedicated mixin for use when jackson-dataformat-xml is on the classpath.
|
||||||
* classpath. For more details, see
|
* For more details, see
|
||||||
* <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 = ProblemDetailJacksonXmlMixin.NAMESPACE)
|
@JacksonXmlRootElement(localName = "problem", namespace = ProblemDetailJacksonXmlMixin.RFC_7807_NAMESPACE)
|
||||||
public interface ProblemDetailJacksonXmlMixin {
|
public interface ProblemDetailJacksonXmlMixin {
|
||||||
|
|
||||||
String NAMESPACE = "urn:ietf:rfc:7807";
|
/** RFC 7807 namespace. */
|
||||||
|
String RFC_7807_NAMESPACE = "urn:ietf:rfc:7807";
|
||||||
|
|
||||||
@JacksonXmlProperty(namespace = NAMESPACE)
|
|
||||||
|
@JacksonXmlProperty(namespace = RFC_7807_NAMESPACE)
|
||||||
URI getType();
|
URI getType();
|
||||||
|
|
||||||
@JacksonXmlProperty(namespace = NAMESPACE)
|
@JacksonXmlProperty(namespace = RFC_7807_NAMESPACE)
|
||||||
String getTitle();
|
String getTitle();
|
||||||
|
|
||||||
@JacksonXmlProperty(namespace = NAMESPACE)
|
@JacksonXmlProperty(namespace = RFC_7807_NAMESPACE)
|
||||||
int getStatus();
|
int getStatus();
|
||||||
|
|
||||||
@JacksonXmlProperty(namespace = NAMESPACE)
|
@JacksonXmlProperty(namespace = RFC_7807_NAMESPACE)
|
||||||
String getDetail();
|
String getDetail();
|
||||||
|
|
||||||
@JacksonXmlProperty(namespace = NAMESPACE)
|
@JacksonXmlProperty(namespace = RFC_7807_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 = NAMESPACE)
|
@JacksonXmlProperty(namespace = RFC_7807_NAMESPACE)
|
||||||
Map<String, Object> getProperties();
|
Map<String, Object> getProperties();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue