cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject svn commit: r1445576 - in /cxf/branches/2.7.x-fixes: ./ rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/AbstractJAXBProvider.java
Date Wed, 13 Feb 2013 12:55:05 GMT
Author: sergeyb
Date: Wed Feb 13 12:55:05 2013
New Revision: 1445576

URL: http://svn.apache.org/r1445576
Log:
Merged revisions 1445575 via svnmerge from 
https://svn.apache.org/repos/asf/cxf/trunk

........
  r1445575 | sergeyb | 2013-02-13 12:50:16 +0000 (Wed, 13 Feb 2013) | 1 line
  
  [CXF-4799] Making it a bit simpler to customize the way JAXB context is created
........

Modified:
    cxf/branches/2.7.x-fixes/   (props changed)
    cxf/branches/2.7.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/AbstractJAXBProvider.java

Propchange: cxf/branches/2.7.x-fixes/
------------------------------------------------------------------------------
    svn:mergeinfo = /cxf/trunk:1445575

Propchange: cxf/branches/2.7.x-fixes/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.

Modified: cxf/branches/2.7.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/AbstractJAXBProvider.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.7.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/AbstractJAXBProvider.java?rev=1445576&r1=1445575&r2=1445576&view=diff
==============================================================================
--- cxf/branches/2.7.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/AbstractJAXBProvider.java
(original)
+++ cxf/branches/2.7.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/AbstractJAXBProvider.java
Wed Feb 13 12:55:05 2013
@@ -108,11 +108,10 @@ public abstract class AbstractJAXBProvid
     protected List<String> inDropElements;
     protected Map<String, String> inElementsMap;
     protected Map<String, String> inAppendMap;
+    protected Map<String, JAXBContext> packageContexts = new HashMap<String, JAXBContext>();
+    protected Map<Class<?>, JAXBContext> classContexts = new HashMap<Class<?>,
JAXBContext>();
     private boolean attributesToElements;
     
-    private Map<String, JAXBContext> packageContexts = new HashMap<String, JAXBContext>();
-    private Map<Class<?>, JAXBContext> classContexts = new HashMap<Class<?>,
JAXBContext>();
-    
     private MessageContext mc;
     
     private Schema schema;
@@ -456,12 +455,14 @@ public abstract class AbstractJAXBProvid
             }
         }
         
-        JAXBContext context = getPackageContext(type);
+        JAXBContext context = getPackageContext(type, genericType);
                 
-        return context != null ? context : getClassContext(type);
+        return context != null ? context : getClassContext(type, genericType);
     }
-    
     public JAXBContext getClassContext(Class<?> type) throws JAXBException {
+        return getClassContext(type, type);
+    }
+    protected JAXBContext getClassContext(Class<?> type, Type genericType) throws JAXBException
{
         synchronized (classContexts) {
             JAXBContext context = classContexts.get(type);
             if (context == null) {
@@ -480,8 +481,10 @@ public abstract class AbstractJAXBProvid
             return context;
         }
     }
-    
     public JAXBContext getPackageContext(Class<?> type) {
+        return getPackageContext(type, type);
+    }
+    protected JAXBContext getPackageContext(Class<?> type, Type genericType) {
         if (type == null || type == JAXBElement.class) {
             return null;
         }



Mime
View raw message