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

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

Introduction

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

Prototype

public void setSchemas(Resource... schemaResources) 

Source Link

Document

Set the schema resources to use for validation.

Usage

From source file:no.digipost.api.xml.Marshalling.java

public static Jaxb2Marshaller createNewMarshaller() {
    Jaxb2Marshaller marshaller = new Jaxb2Marshaller();
    marshaller.setPackagesToScan(new String[] { packageName(StandardBusinessDocument.class),
            packageName(Envelope.class), packageName(org.w3.soap.Envelope.class),
            packageName(org.w3.xmldsig.Reference.class), packageName(Messaging.class),
            packageName(NonRepudiationInformation.class), packageName(SDPKvittering.class),
            packageName(XAdESSignatures.class), packageName(QualifyingProperties.class) });
    marshaller.setSchemas(Schemas.allSchemaResources());
    return marshaller;
}

From source file:org.beast.project.template.config.WebServiceConfig.java

@Bean
public Jaxb2Marshaller payloadMarshaller() {
    Jaxb2Marshaller marshaller = new Jaxb2Marshaller();
    marshaller.setContextPath(ClassUtils.getPackageName(org.beast.project.template.model.ObjectFactory.class));
    marshaller.setSchemas(schemaResources());
    return marshaller;
}