XmlInterventionVariable extends XmlRegressionVariable { public static final Adapter getAdapter() { return ADAPTER; }  List<XmlSpan> getSequences(); Double getDeltaFilter(); void setDeltaFilter(Double value); Double getDeltaSeasonalFilter(); void setDeltaSeasonalFilter(Double value); static final Adapter getAdapter();  }
@Test @Ignore public void testFile() throws FileNotFoundException, JAXBException, IOException { JAXBContext jaxb = JAXBContext.newInstance(XmlInterventionVariable.class); InterventionVariable ivar = new InterventionVariable(); ivar.setDelta(.9); Day d0 = new Day(1999, Month.April, 3); Day d1 = new Day(2005, Month.June, 3); ivar.add(d0, d0); ivar.add(d1, d1.plus(90)); XmlInterventionVariable xvar = XmlInterventionVariable.getAdapter().marshal(ivar); FileOutputStream ostream = new FileOutputStream(FILE); try (OutputStreamWriter writer = new OutputStreamWriter(ostream, StandardCharsets.UTF_8)) { Marshaller marshaller = jaxb.createMarshaller(); marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true); marshaller.marshal(new JAXBElement(QName.valueOf("test"), XmlInterventionVariable.class, xvar), writer); writer.flush(); } XmlInterventionVariable rslt = null; FileInputStream istream = new FileInputStream(FILE); try (InputStreamReader reader = new InputStreamReader(istream, StandardCharsets.UTF_8)) { Source source = new StreamSource(reader); Unmarshaller unmarshaller = jaxb.createUnmarshaller(); JAXBElement<XmlInterventionVariable> jrslt = unmarshaller.unmarshal(source, XmlInterventionVariable.class); rslt=jrslt.getValue(); InterventionVariable nvar = XmlInterventionVariable.getAdapter().unmarshal(rslt); } }