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

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

Introduction

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

Prototype

public void setCheckForXmlRootElement(boolean checkForXmlRootElement) 

Source Link

Document

Specify whether the #supports(Class) should check for XmlRootElement @XmlRootElement annotations.

Usage

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

/**
 * <p>getJaxbMarshaller.</p>
 *
 * @return a {@link org.springframework.oxm.jaxb.Jaxb2Marshaller} object.
 *//*from  w  w  w .ja  v  a 2 s  .c  om*/
@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;
}