Package feign.jaxb
Class JAXBDecoder
- java.lang.Object
-
- feign.jaxb.JAXBDecoder
-
- All Implemented Interfaces:
feign.codec.Decoder
public class JAXBDecoder extends java.lang.Object implements feign.codec.Decoder
Decodes responses using JAXB.
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.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
JAXBDecoder.Builder
-
Constructor Summary
Constructors Constructor Description JAXBDecoder(JAXBContextFactory jaxbContextFactory)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Object
decode(feign.Response response, java.lang.reflect.Type type)
-
-
-
Constructor Detail
-
JAXBDecoder
public JAXBDecoder(JAXBContextFactory jaxbContextFactory)
-
-