@Test public void testUnmarshal() throws JAXBException { Car car = UnmarshalHelper.unmarshal(file); assertEquals(car.toString(), "Car [make=Golf, manufacturer=Volkswagen, id=DEF-456]"); }
public static Car unmarshal(File file) throws JAXBException { JAXBContext jaxbContext = JAXBContext.newInstance(Car.class); Unmarshaller jaxbUnmarshaller = jaxbContext.createUnmarshaller(); JAXBElement<Car> root = jaxbUnmarshaller.unmarshal(new StreamSource( file), Car.class); Car car = root.getValue(); LOGGER.info(car.toString()); return car; }
UnmarshalHelper { public static Car unmarshal(File file) throws JAXBException { JAXBContext jaxbContext = JAXBContext.newInstance(Car.class); Unmarshaller jaxbUnmarshaller = jaxbContext.createUnmarshaller(); JAXBElement<Car> root = jaxbUnmarshaller.unmarshal(new StreamSource( file), Car.class); Car car = root.getValue(); LOGGER.info(car.toString()); return car; } }
UnmarshalHelper { public static Car unmarshal(File file) throws JAXBException { JAXBContext jaxbContext = JAXBContext.newInstance(Car.class); Unmarshaller jaxbUnmarshaller = jaxbContext.createUnmarshaller(); JAXBElement<Car> root = jaxbUnmarshaller.unmarshal(new StreamSource( file), Car.class); Car car = root.getValue(); LOGGER.info(car.toString()); return car; } private  UnmarshalHelper(); }
UnmarshalHelper { public static Car unmarshal(File file) throws JAXBException { JAXBContext jaxbContext = JAXBContext.newInstance(Car.class); Unmarshaller jaxbUnmarshaller = jaxbContext.createUnmarshaller(); JAXBElement<Car> root = jaxbUnmarshaller.unmarshal(new StreamSource( file), Car.class); Car car = root.getValue(); LOGGER.info(car.toString()); return car; } private  UnmarshalHelper(); static Car unmarshalError(File file); static Car unmarshal(File file); }
UnmarshalHelper { public static Car unmarshal(File file) throws JAXBException { JAXBContext jaxbContext = JAXBContext.newInstance(Car.class); Unmarshaller jaxbUnmarshaller = jaxbContext.createUnmarshaller(); JAXBElement<Car> root = jaxbUnmarshaller.unmarshal(new StreamSource( file), Car.class); Car car = root.getValue(); LOGGER.info(car.toString()); return car; } private  UnmarshalHelper(); static Car unmarshalError(File file); static Car unmarshal(File file);  }