public class JAXBDecoder
extends java.lang.Object
implements feign.codec.Decoder
Basic example with with Feign.Builder:
JAXBContextFactory jaxbFactory = new JAXBContextFactory.Builder()
.withMarshallerJAXBEncoding("UTF-8")
.withMarshallerSchemaLocation("http://apihost http://apihost/schema.xsd")
.build();
api = Feign.builder()
.decoder(new JAXBDecoder(jaxbFactory))
.target(MyApi.class, "http://api");
The JAXBContextFactory should be reused across requests as it caches the created JAXB contexts.
| Constructor and Description |
|---|
JAXBDecoder(JAXBContextFactory jaxbContextFactory) |
| Modifier and Type | Method and Description |
|---|---|
java.lang.Object |
decode(feign.Response response,
java.lang.reflect.Type type) |
public JAXBDecoder(JAXBContextFactory jaxbContextFactory)