Package com.ketayao.ketacustom.spring

Examples of com.ketayao.ketacustom.spring.DataControlXML$Condition


   
    Condition condition2 = new Condition();
    condition2.setName("条件标题2");
    condition2.setContent("条件内容2");
   
    DataControlXML bean = new DataControlXML();
    bean.getItems().add(condition);
    bean.getItems().add(condition2);

        JAXBContext jaxbContext = JAXBContext.newInstance(DataControlXML.class)
        Marshaller jaxbMarshaller = jaxbContext.createMarshaller()
        // output pretty printed 
        jaxbMarshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true)
View Full Code Here


  @Test
  public void testCreateBean() throws Exception {
    JAXBContext jc = JAXBContext.newInstance(DataControlXML.class);
        Unmarshaller unmarshaller = jc.createUnmarshaller();
        File xml = new File(DataControlXMLTest.class.getResource("").getPath() + "test.xml");
        DataControlXML root = (DataControlXML) unmarshaller.unmarshal(xml);

        Marshaller marshaller = jc.createMarshaller();
        marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true);
        marshaller.marshal(root, System.out);
  }
View Full Code Here

TOP

Related Classes of com.ketayao.ketacustom.spring.DataControlXML$Condition

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.