Examples of Jaxb2Marshaller


Examples of org.springframework.oxm.jaxb.Jaxb2Marshaller

    File directory = new File("build/data");
    directory.mkdirs();
    resource = new FileSystemResource(File.createTempFile("StaxEventWriterOutputSourceTests", ".xml", directory));
    writer = createItemWriter();
    executionContext = new ExecutionContext();
    jaxbMarshaller = new Jaxb2Marshaller();
    jaxbMarshaller.setClassesToBeBound(JAXBItem.class);
  }
View Full Code Here

Examples of org.springframework.oxm.jaxb.Jaxb2Marshaller

    outputFile.delete();
  }

  protected Marshaller getMarshaller() throws Exception {
   
    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

Examples of org.springframework.oxm.jaxb.Jaxb2Marshaller

  }

  protected Unmarshaller getUnmarshaller() throws Exception {

    Jaxb2Marshaller marshaller = new Jaxb2Marshaller();
    marshaller.setClassesToBeBound(new Class<?>[] { QualifiedTrade.class });
    marshaller.setSchema(new ClassPathResource("trade.xsd", Trade.class));
    marshaller.afterPropertiesSet();

    return marshaller;
  }
View Full Code Here

Examples of org.springframework.oxm.jaxb.Jaxb2Marshaller

  @Override
  protected Unmarshaller getUnmarshaller() throws Exception {
    reader.setFragmentRootElementName("trade");

    Jaxb2Marshaller marshaller = new Jaxb2Marshaller();
    marshaller.setClassesToBeBound(new Class<?>[] { Trade.class });
    // marshaller.setSchema(new ClassPathResource("trade.xsd", Trade.class));
    marshaller.afterPropertiesSet();
   
    return marshaller;
  }
View Full Code Here

Examples of org.springframework.oxm.jaxb.Jaxb2Marshaller

public class Jaxb2MarshallingTests extends AbstractStaxEventWriterItemWriterTests {

  @Override
  protected Marshaller getMarshaller() throws Exception {
   
    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

Examples of org.springframework.oxm.jaxb.Jaxb2Marshaller

    Jaxb2Marshaller marshaller;

    @Before
    public void setUp() {
        this.marshaller = new Jaxb2Marshaller();
        this.marshaller.setClassesToBeBound(new Class[]{Leg.class});
    }
View Full Code Here

Examples of org.springframework.oxm.jaxb.Jaxb2Marshaller

            "<endLocation city='Buenos Aires' countryCode='AR'/>" +
            "</leg></legQuote>";

    @Before
    public void setUp() {
        this.marshaller = new Jaxb2Marshaller();
        this.marshaller.setClassesToBeBound(new Class[]{LegQuoteCommand.class});
        this.exampleLegQuote = new LegQuoteCommand(new Leg(startLegDateTime, endLegDateTime, london, buenosAires));

        CarCriteria carCriteria = new CarCriteria();
        carCriteria.setCarType(CarType.Compact);
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.