From de069d06d852e6fa2e8e4ca9d442168729af6588 Mon Sep 17 00:00:00 2001 From: Juergen Hoeller Date: Wed, 27 Feb 2013 00:26:27 +0100 Subject: [PATCH] Made "getJaxbContext()" method public Issue: SPR-10282 --- .../org/springframework/oxm/jaxb/Jaxb2Marshaller.java | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/spring-oxm/src/main/java/org/springframework/oxm/jaxb/Jaxb2Marshaller.java b/spring-oxm/src/main/java/org/springframework/oxm/jaxb/Jaxb2Marshaller.java index 3684aa3b9f..4ffd0c495d 100644 --- a/spring-oxm/src/main/java/org/springframework/oxm/jaxb/Jaxb2Marshaller.java +++ b/spring-oxm/src/main/java/org/springframework/oxm/jaxb/Jaxb2Marshaller.java @@ -417,7 +417,10 @@ public class Jaxb2Marshaller } } - protected JAXBContext getJaxbContext() { + /** + * Return the JAXBContext used by this marshaller, lazily building it if necessary. + */ + public JAXBContext getJaxbContext() { if (this.jaxbContext != null) { return this.jaxbContext; } @@ -525,10 +528,8 @@ public class Jaxb2Marshaller public boolean supports(Class clazz) { - if (this.supportJaxbElementClass && JAXBElement.class.isAssignableFrom(clazz)) { - return true; - } - return supportsInternal(clazz, this.checkForXmlRootElement); + return ((this.supportJaxbElementClass && JAXBElement.class.isAssignableFrom(clazz)) || + supportsInternal(clazz, this.checkForXmlRootElement)); } public boolean supports(Type genericType) {