@Test public void testUnmarshal() throws JAXBException { Car car = UnmarshalHelper.unmarshal(xml); assertEquals(car.toString(), "Car [make=Passat, manufacturer=Volkswagen, id=ABC-123]"); }
public static Car unmarshal(String xml) throws JAXBException { JAXBContext jaxbContext = JAXBContext.newInstance(Car.class); Unmarshaller jaxbUnmarshaller = jaxbContext.createUnmarshaller(); StringReader reader = new StringReader(xml); Car car = (Car) jaxbUnmarshaller.unmarshal(reader); LOGGER.info(car.toString()); return car; }
UnmarshalHelper { public static Car unmarshal(String xml) throws JAXBException { JAXBContext jaxbContext = JAXBContext.newInstance(Car.class); Unmarshaller jaxbUnmarshaller = jaxbContext.createUnmarshaller(); StringReader reader = new StringReader(xml); Car car = (Car) jaxbUnmarshaller.unmarshal(reader); LOGGER.info(car.toString()); return car; } }
UnmarshalHelper { public static Car unmarshal(String xml) throws JAXBException { JAXBContext jaxbContext = JAXBContext.newInstance(Car.class); Unmarshaller jaxbUnmarshaller = jaxbContext.createUnmarshaller(); StringReader reader = new StringReader(xml); Car car = (Car) jaxbUnmarshaller.unmarshal(reader); LOGGER.info(car.toString()); return car; } private  UnmarshalHelper(); }
UnmarshalHelper { public static Car unmarshal(String xml) throws JAXBException { JAXBContext jaxbContext = JAXBContext.newInstance(Car.class); Unmarshaller jaxbUnmarshaller = jaxbContext.createUnmarshaller(); StringReader reader = new StringReader(xml); Car car = (Car) jaxbUnmarshaller.unmarshal(reader); LOGGER.info(car.toString()); return car; } private  UnmarshalHelper(); static Car unmarshal(String xml); }
UnmarshalHelper { public static Car unmarshal(String xml) throws JAXBException { JAXBContext jaxbContext = JAXBContext.newInstance(Car.class); Unmarshaller jaxbUnmarshaller = jaxbContext.createUnmarshaller(); StringReader reader = new StringReader(xml); Car car = (Car) jaxbUnmarshaller.unmarshal(reader); LOGGER.info(car.toString()); return car; } private  UnmarshalHelper(); static Car unmarshal(String xml);  }