Class ParseXMLWithJAXB<T>

  • All Implemented Interfaces:
    com.google.common.base.Function<HttpResponse,​T>, Function<HttpResponse,​T>

    @Singleton
    public class ParseXMLWithJAXB<T>
    extends Object
    implements com.google.common.base.Function<HttpResponse,​T>
    This object will parse the body of an HttpResponse and return the result of type back to the caller.

    JAXBContext works with Class objects instead of Type. This could be a limitation if we are trying to parse typed collections of objects. However, when using JAXB we expect to have well formed XML documents with one single root element, so the objects to parse should not be collections but objects that wrap collections of elements, and that should work fine.