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

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

Introduction

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

Prototype

public void setLazyInit(boolean lazyInit) 

Source Link

Document

Set whether to lazily initialize the JAXBContext for this marshaller.

Usage

From source file:org.agatom.springatom.data.xml.OXMLConfiguration.java

/**
 * <p>getJaxbMarshaller.</p>
 *
 * @return a {@link org.springframework.oxm.jaxb.Jaxb2Marshaller} object.
 *//*  w  ww  .  j  a  va  2 s.  com*/
@Bean(name = "jaxbMarshaller")
@Scope(ConfigurableBeanFactory.SCOPE_SINGLETON)
public Jaxb2Marshaller getJaxbMarshaller() {
    final Jaxb2Marshaller jaxb2Marshaller = new Jaxb2Marshaller();
    jaxb2Marshaller.setLazyInit(this.environment.getProperty("springatom.oxm.lazyInit", Boolean.class));
    jaxb2Marshaller.setPackagesToScan(
            StringUtils.split(this.environment.getProperty("springatom.oxm.packagesToScan"), ","));
    jaxb2Marshaller.setCheckForXmlRootElement(true);
    jaxb2Marshaller.setProcessExternalEntities(true);
    return jaxb2Marshaller;
}