cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject svn commit: r1309357 - /cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/AbstractJAXBProvider.java
Date Wed, 04 Apr 2012 12:23:00 GMT
Author: sergeyb
Date: Wed Apr  4 12:23:00 2012
New Revision: 1309357

URL: http://svn.apache.org/viewvc?rev=1309357&view=rev
Log:
[CXF-4225] Updating JAXBElementProvider to support Listener properties

Modified:
    cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/AbstractJAXBProvider.java

Modified: cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/AbstractJAXBProvider.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/AbstractJAXBProvider.java?rev=1309357&r1=1309356&r2=1309357&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/AbstractJAXBProvider.java
(original)
+++ cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/AbstractJAXBProvider.java
Wed Apr  4 12:23:00 2012
@@ -119,6 +119,8 @@ public abstract class AbstractJAXBProvid
     private boolean validateOutput;
     private boolean validateBeforeWrite;
     private ValidationEventHandler eventHandler;
+    private Unmarshaller.Listener unmarshallerListener;
+    private Marshaller.Listener marshallerListener;
     private DocumentDepthProperties depthProperties;
     
     public void setValidationHandler(ValidationEventHandler handler) {
@@ -467,6 +469,9 @@ public abstract class AbstractJAXBProvid
         if (eventHandler != null) {
             unmarshaller.setEventHandler(eventHandler);
         }
+        if (unmarshallerListener != null) {
+            unmarshaller.setListener(unmarshallerListener);
+        }
         if (uProperties != null) {
             for (Map.Entry<String, Object> entry : uProperties.entrySet()) {
                 unmarshaller.setProperty(entry.getKey(), entry.getValue());
@@ -486,6 +491,9 @@ public abstract class AbstractJAXBProvid
         if (enc != null) {
             marshaller.setProperty(Marshaller.JAXB_ENCODING, enc);
         }
+        if (marshallerListener != null) {
+            marshaller.setListener(marshallerListener);
+        }
         validateObjectIfNeeded(marshaller, obj);
         return marshaller;
     }
@@ -661,6 +669,14 @@ public abstract class AbstractJAXBProvid
         this.depthProperties = depthProperties;
     }
 
+    public void setUnmarshallerListener(Unmarshaller.Listener unmarshallerListener) {
+        this.unmarshallerListener = unmarshallerListener;
+    }
+
+    public void setMarshallerListener(Marshaller.Listener marshallerListener) {
+        this.marshallerListener = marshallerListener;
+    }
+
     @XmlRootElement
     protected static class CollectionWrapper {
         



Mime
View raw message