Package org.springframework.oxm.jaxb

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


        wac.registerBeanDefinition("controller", new RootBeanDefinition(RequestBodyArgMismatchController.class));

        Jaxb2Marshaller marshaller = new Jaxb2Marshaller();
        marshaller.setClassesToBeBound(A.class, B.class);
        try {
          marshaller.afterPropertiesSet();
        }
        catch (Exception ex) {
          throw new BeanCreationException(ex.getMessage(), ex);
        }
View Full Code Here


      @Override
      public void initialize(GenericWebApplicationContext wac) {
        Jaxb2Marshaller marshaller = new Jaxb2Marshaller();
        marshaller.setClassesToBeBound(A.class, B.class);
        try {
          marshaller.afterPropertiesSet();
        }
        catch (Exception ex) {
          throw new BeanCreationException(ex.getMessage(), ex);
        }
        MarshallingHttpMessageConverter messageConverter = new MarshallingHttpMessageConverter(marshaller);
View Full Code Here

        final IDataUpgrader xsltDataUpgrader = createXsltDataUpgrader(xslResource, UserPortalDataType.IMPORT_32_DATA_KEY);
        dataImportExportService.setDataUpgraders(Arrays.asList(xsltDataUpgrader));
       
        final Jaxb2Marshaller userJaxb2Marshaller = new Jaxb2Marshaller();
        userJaxb2Marshaller.setContextPath("org.jasig.portal.io.xml.user");
        userJaxb2Marshaller.afterPropertiesSet();
       
        final IDataImporter<ExternalUser> userDataImporter = mock(IDataImporter.class);
        when(userDataImporter.getImportDataKeys()).thenReturn(Collections.singleton(UserPortalDataType.IMPORT_40_DATA_KEY));
        when(userDataImporter.getUnmarshaller()).thenReturn(userJaxb2Marshaller);
       
View Full Code Here

  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>"));
View Full Code Here

  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

    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

  @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>"));
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.