Example usage for org.springframework.oxm.jaxb Jaxb2Marshaller setContextPaths

List of usage examples for org.springframework.oxm.jaxb Jaxb2Marshaller setContextPaths

Introduction

In this page you can find the example usage for org.springframework.oxm.jaxb Jaxb2Marshaller setContextPaths.

Prototype

public void setContextPaths(String... contextPaths) 

Source Link

Document

Set multiple JAXB context paths.

Usage

From source file:org.bremersee.common.spring.autoconfigure.JaxbAutoConfiguration.java

public static Jaxb2Marshaller createJaxbMarshaller(final Collection<String> packages) {
    final Set<String> packageSet = createPackageSet(packages);
    Jaxb2Marshaller m = new Jaxb2Marshaller();
    Map<String, Object> marshallerProperties = new HashMap<>();
    marshallerProperties.put(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE);
    m.setMarshallerProperties(marshallerProperties);
    m.setContextPaths(packageSet.toArray(new String[packageSet.size()]));
    return m;//from w w w  .  j ava  2s .c  o  m
}

From source file:org.osgp.adapter.protocol.dlms.application.config.JasperWirelessConfig.java

@Bean
public Jaxb2Marshaller marshaller() {
    final Jaxb2Marshaller marshaller = new Jaxb2Marshaller();
    marshaller.setContextPaths("com.jasperwireless.api.ws.service");
    return marshaller;
}