/** * Create a new {@link Unmarshaller} for the given class. * @param clazz the class to create the unmarshaller for * @return the {@code Unmarshaller} * @throws HttpMessageConversionException in case of JAXB errors */ protected final Unmarshaller createUnmarshaller(Class<?> clazz) { try { JAXBContext jaxbContext = getJaxbContext(clazz); Unmarshaller unmarshaller = jaxbContext.createUnmarshaller(); customizeUnmarshaller(unmarshaller); return unmarshaller; } catch (JAXBException ex) { throw new HttpMessageConversionException( "Could not create Unmarshaller for class [" + clazz + "]: " + ex.getMessage(), ex); } }
/** * Create a new {@link Unmarshaller} for the given class. * @param clazz the class to create the unmarshaller for * @return the {@code Unmarshaller} * @throws HttpMessageConversionException in case of JAXB errors */ protected final Unmarshaller createUnmarshaller(Class<?> clazz) { try { JAXBContext jaxbContext = getJaxbContext(clazz); Unmarshaller unmarshaller = jaxbContext.createUnmarshaller(); customizeUnmarshaller(unmarshaller); return unmarshaller; } catch (JAXBException ex) { throw new HttpMessageConversionException( "Could not create Unmarshaller for class [" + clazz + "]: " + ex.getMessage(), ex); } }
/** * Create a new {@link Unmarshaller} for the given class. * @param clazz the class to create the unmarshaller for * @return the {@code Unmarshaller} * @throws HttpMessageConversionException in case of JAXB errors */ protected final Unmarshaller createUnmarshaller(Class<?> clazz) { try { JAXBContext jaxbContext = getJaxbContext(clazz); Unmarshaller unmarshaller = jaxbContext.createUnmarshaller(); customizeUnmarshaller(unmarshaller); return unmarshaller; } catch (JAXBException ex) { throw new HttpMessageConversionException( "Could not create Unmarshaller for class [" + clazz + "]: " + ex.getMessage(), ex); } }
/** * Create a new {@link Unmarshaller} for the given class. * @param clazz the class to create the unmarshaller for * @return the {@code Unmarshaller} * @throws HttpMessageConversionException in case of JAXB errors */ protected final Unmarshaller createUnmarshaller(Class<?> clazz) { try { JAXBContext jaxbContext = getJaxbContext(clazz); Unmarshaller unmarshaller = jaxbContext.createUnmarshaller(); customizeUnmarshaller(unmarshaller); return unmarshaller; } catch (JAXBException ex) { throw new HttpMessageConversionException( "Could not create Unmarshaller for class [" + clazz + "]: " + ex.getMessage(), ex); } }