public class JAXBDecoder extends Object implements 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.
| Modifier and Type | Class and Description |
|---|---|
static class |
JAXBDecoder.Builder |
Decoder.Default| Constructor and Description |
|---|
JAXBDecoder(JAXBContextFactory jaxbContextFactory) |
public JAXBDecoder(JAXBContextFactory jaxbContextFactory)
public Object decode(Response response, Type type) throws IOException
decode in interface DecoderIOExceptionCopyright © 2012–2022 OpenFeign. All rights reserved.