Package org.springframework.oxm.jaxb

Examples of org.springframework.oxm.jaxb.Jaxb2Marshaller.marshal()


    Jaxb2Marshaller marshaller = new Jaxb2Marshaller();
    marshaller.setClassesToBeBound(new Class<?>[] { QualifiedTrade.class });
    marshaller.afterPropertiesSet();
   
    StringWriter string = new StringWriter();
    marshaller.marshal(new QualifiedTrade("FOO", 100, BigDecimal.valueOf(10.), "bar"), new StreamResult(string));
    String content = string.toString();
    assertTrue("Wrong content: "+content, content.contains("<customer>bar</customer>"));
    return marshaller;
  }
View Full Code Here


    Jaxb2Marshaller marshaller = new Jaxb2Marshaller();
    marshaller.setClassesToBeBound(new Class<?>[] { Trade.class });
    marshaller.afterPropertiesSet();
   
    StringWriter string = new StringWriter();
    marshaller.marshal(new Trade("FOO", 100, BigDecimal.valueOf(10.), "bar"), new StreamResult(string));
    String content = string.toString();
    assertTrue("Wrong content: "+content, content.contains("<customer>bar</customer>"));
    return marshaller;
  }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.