Search in sources :

Example 11 with Jaxb2Marshaller

use of org.springframework.oxm.jaxb.Jaxb2Marshaller in project tutorials by eugenp.

the class SpringbatchPartitionConfig method marshaller.

@Bean
public Marshaller marshaller() {
    Jaxb2Marshaller marshaller = new Jaxb2Marshaller();
    marshaller.setClassesToBeBound(Transaction.class);
    return marshaller;
}
Also used : Jaxb2Marshaller(org.springframework.oxm.jaxb.Jaxb2Marshaller) JobRepositoryFactoryBean(org.springframework.batch.core.repository.support.JobRepositoryFactoryBean) Bean(org.springframework.context.annotation.Bean)

Example 12 with Jaxb2Marshaller

use of org.springframework.oxm.jaxb.Jaxb2Marshaller in project irida by phac-nml.

the class IridaWorkflowsConfig method workflowDescriptionUnmarshaller.

/**
 * Sets up an {@link Unmarshaller} for workflow objects.
 *
 * @return An {@link Unmarshaller} for workflow objects.
 */
@Bean
public Unmarshaller workflowDescriptionUnmarshaller() {
    Jaxb2Marshaller jaxb2marshaller = new Jaxb2Marshaller();
    jaxb2marshaller.setPackagesToScan(new String[] { "ca.corefacility.bioinformatics.irida.model.workflow" });
    return jaxb2marshaller;
}
Also used : Jaxb2Marshaller(org.springframework.oxm.jaxb.Jaxb2Marshaller) Bean(org.springframework.context.annotation.Bean)

Example 13 with Jaxb2Marshaller

use of org.springframework.oxm.jaxb.Jaxb2Marshaller in project nzbhydra2 by theotherp.

the class WebConfiguration method marshaller.

/**
 * Enable pretty printing of returned XML
 */
@Bean
public Jaxb2Marshaller marshaller() {
    Jaxb2Marshaller marshaller = new Jaxb2Marshaller();
    Map<String, Boolean> map = new HashMap<>();
    map.put(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE);
    marshaller.setMarshallerProperties(map);
    marshaller.setPackagesToScan("org.nzbhydra");
    return marshaller;
}
Also used : HashMap(java.util.HashMap) Jaxb2Marshaller(org.springframework.oxm.jaxb.Jaxb2Marshaller) FilterRegistrationBean(org.springframework.boot.web.servlet.FilterRegistrationBean) Bean(org.springframework.context.annotation.Bean)

Example 14 with Jaxb2Marshaller

use of org.springframework.oxm.jaxb.Jaxb2Marshaller in project citrus-samples by christophd.

the class CitrusEndpointConfig method jax2bMarshaller.

@Bean
public Marshaller jax2bMarshaller() {
    Jaxb2Marshaller jaxb2Marshaller = new Jaxb2Marshaller();
    jaxb2Marshaller.setContextPath("com.consol.citrus.samples.bookstore.model");
    return jaxb2Marshaller;
}
Also used : Jaxb2Marshaller(org.springframework.oxm.jaxb.Jaxb2Marshaller)

Example 15 with Jaxb2Marshaller

use of org.springframework.oxm.jaxb.Jaxb2Marshaller in project citrus-samples by christophd.

the class CitrusEndpointConfig method jax2bMarshaller.

@Bean
public Marshaller jax2bMarshaller() {
    Jaxb2Marshaller jaxb2Marshaller = new Jaxb2Marshaller();
    jaxb2Marshaller.setClassesToBeBound(OpenIncident.class, OpenIncidentResponse.class, AnalyseIncident.class, AnalyseIncidentResponse.class, OrderRequest.class, OrderNotification.class, SendSmsRequest.class, SendSmsResponse.class);
    return jaxb2Marshaller;
}
Also used : Jaxb2Marshaller(org.springframework.oxm.jaxb.Jaxb2Marshaller)

Aggregations

Jaxb2Marshaller (org.springframework.oxm.jaxb.Jaxb2Marshaller)35 Bean (org.springframework.context.annotation.Bean)13 Test (org.junit.Test)7 MarshallingView (org.springframework.web.servlet.view.xml.MarshallingView)7 Test (org.junit.jupiter.api.Test)6 ArrayList (java.util.ArrayList)4 HashMap (java.util.HashMap)4 View (org.springframework.web.servlet.View)4 MappingJackson2JsonView (org.springframework.web.servlet.view.json.MappingJackson2JsonView)4 SimpleXml (com.hack23.cia.service.external.common.impl.test.SimpleXml)3 IOException (java.io.IOException)3 FilterRegistrationBean (org.springframework.boot.web.servlet.FilterRegistrationBean)3 ContentNegotiationManager (org.springframework.web.accept.ContentNegotiationManager)3 FixedContentNegotiationStrategy (org.springframework.web.accept.FixedContentNegotiationStrategy)3 HeaderContentNegotiationStrategy (org.springframework.web.accept.HeaderContentNegotiationStrategy)3 ContentNegotiatingViewResolver (org.springframework.web.servlet.view.ContentNegotiatingViewResolver)3 InternalResourceViewResolver (org.springframework.web.servlet.view.InternalResourceViewResolver)3 InputStream (java.io.InputStream)2 URISyntaxException (java.net.URISyntaxException)2 lombok.val (lombok.val)2