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

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

Introduction

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

Prototype

public void setProcessExternalEntities(boolean processExternalEntities) 

Source Link

Document

Indicate whether external XML entities are processed when unmarshalling.

Usage

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

/**
 * <p>getJaxbMarshaller.</p>
 *
 * @return a {@link org.springframework.oxm.jaxb.Jaxb2Marshaller} object.
 */// ww w  . j a v a  2s .  co m
@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;
}