cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dand...@apache.org
Subject svn commit: r546956 - in /incubator/cxf/trunk: api/src/main/java/org/apache/cxf/databinding/ rt/core/src/main/java/org/apache/cxf/databinding/source/ rt/core/src/main/java/org/apache/cxf/interceptor/ rt/databinding/aegis/src/main/java/org/apache/cxf/ae...
Date Wed, 13 Jun 2007 17:00:23 GMT
Author: dandiep
Date: Wed Jun 13 10:00:22 2007
New Revision: 546956

URL: http://svn.apache.org/viewvc?view=rev&rev=546956
Log:
Check for UTF-8 Encoding  for the JAXB optimization hack instead of passing the encoding along
(The optimization doesn't work for non UTF-8 encodings)

Modified:
    incubator/cxf/trunk/api/src/main/java/org/apache/cxf/databinding/DataWriter.java
    incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/databinding/source/NodeDataWriter.java
    incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/databinding/source/XMLStreamDataWriter.java
    incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/AbstractOutDatabindingInterceptor.java
    incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/databinding/XMLStreamDataWriter.java
    incubator/cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBEncoderDecoder.java
    incubator/cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/io/DataWriterImpl.java

Modified: incubator/cxf/trunk/api/src/main/java/org/apache/cxf/databinding/DataWriter.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/api/src/main/java/org/apache/cxf/databinding/DataWriter.java?view=diff&rev=546956&r1=546955&r2=546956
==============================================================================
--- incubator/cxf/trunk/api/src/main/java/org/apache/cxf/databinding/DataWriter.java (original)
+++ incubator/cxf/trunk/api/src/main/java/org/apache/cxf/databinding/DataWriter.java Wed Jun
13 10:00:22 2007
@@ -31,5 +31,4 @@
     void write(Object obj, MessagePartInfo part, T output);
     void setSchema(Schema s);
     void setAttachments(Collection<Attachment> attachments);
-    void setEncoding(String encoding);
 }

Modified: incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/databinding/source/NodeDataWriter.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/databinding/source/NodeDataWriter.java?view=diff&rev=546956&r1=546955&r2=546956
==============================================================================
--- incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/databinding/source/NodeDataWriter.java
(original)
+++ incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/databinding/source/NodeDataWriter.java
Wed Jun 13 10:00:22 2007
@@ -43,8 +43,6 @@
 public class NodeDataWriter implements DataWriter<Node> {
     private static final Logger LOG = LogUtils.getL7dLogger(NodeDataWriter.class);
 
-    private String encoding;
-    
     public void write(Object obj, MessagePartInfo part, Node output) {
         write(obj, output);
     }
@@ -72,12 +70,4 @@
     public void setAttachments(Collection<Attachment> attachments) {
  
     }
-    public String getEncoding() {
-        return encoding;
-    }
-
-    public void setEncoding(String encoding) {
-        this.encoding = encoding;
-    }
-    
 }

Modified: incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/databinding/source/XMLStreamDataWriter.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/databinding/source/XMLStreamDataWriter.java?view=diff&rev=546956&r1=546955&r2=546956
==============================================================================
--- incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/databinding/source/XMLStreamDataWriter.java
(original)
+++ incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/databinding/source/XMLStreamDataWriter.java
Wed Jun 13 10:00:22 2007
@@ -39,8 +39,6 @@
 public class XMLStreamDataWriter implements DataWriter<XMLStreamWriter> {
     private static final Logger LOG = LogUtils.getL7dLogger(XMLStreamDataWriter.class);
 
-    private String encoding;
-    
     public void write(Object obj, MessagePartInfo part, XMLStreamWriter output) {
         write(obj, output);
     }
@@ -66,14 +64,5 @@
 
     public void setAttachments(Collection<Attachment> attachments) {
 
-    }
-    
-    public String getEncoding() {
-        return encoding;
-    }
-
-    public void setEncoding(String encoding) {
-        this.encoding = encoding;
-    }
-    
+    }   
 }

Modified: incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/AbstractOutDatabindingInterceptor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/AbstractOutDatabindingInterceptor.java?view=diff&rev=546956&r1=546955&r2=546956
==============================================================================
--- incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/AbstractOutDatabindingInterceptor.java
(original)
+++ incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/AbstractOutDatabindingInterceptor.java
Wed Jun 13 10:00:22 2007
@@ -81,8 +81,7 @@
             }
             
             DataWriter<OutputStream> osWriter = getDataWriter(message, service, OutputStream.class);
-            osWriter.setEncoding((String)message.get(Message.ENCODING));
-            
+
             for (MessagePartInfo part : parts) {
                 int idx = part.getMessageInfo().getMessagePartIndex(part);
                 
@@ -111,9 +110,11 @@
             return false;
         }
         
+        String enc = (String)m.get(Message.ENCODING);
         return info.getClass().getName().equals("org.apache.cxf.binding.soap.model.SoapBindingInfo")

             && s.getDataBinding().getClass().getName().equals("org.apache.cxf.jaxb.JAXBDataBinding")
-            && !MessageUtils.isDOMPresent(m);
+            && !MessageUtils.isDOMPresent(m)
+            && (enc == null || "UTF-8".equals(enc));
     }
     
     protected <T> DataWriter<T> getDataWriter(Message message, Service service,
Class<T> output) {

Modified: incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/databinding/XMLStreamDataWriter.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/databinding/XMLStreamDataWriter.java?view=diff&rev=546956&r1=546955&r2=546956
==============================================================================
--- incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/databinding/XMLStreamDataWriter.java
(original)
+++ incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/databinding/XMLStreamDataWriter.java
Wed Jun 13 10:00:22 2007
@@ -45,8 +45,6 @@
 
     private Collection<Attachment> attachments;
     
-    private String encoding;
-    
     public XMLStreamDataWriter(AegisDatabinding databinding) {
         this.databinding = databinding;
     }
@@ -97,13 +95,4 @@
     public void write(Object obj, XMLStreamWriter output) {
         write(obj, null, output);
     }
-
-    public String getEncoding() {
-        return encoding;
-    }
-
-    public void setEncoding(String encoding) {
-        this.encoding = encoding;
-    }
-    
 }

Modified: incubator/cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBEncoderDecoder.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBEncoderDecoder.java?view=diff&rev=546956&r1=546955&r2=546956
==============================================================================
--- incubator/cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBEncoderDecoder.java
(original)
+++ incubator/cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBEncoderDecoder.java
Wed Jun 13 10:00:22 2007
@@ -81,7 +81,7 @@
                                 Object elValue, 
                                 MessagePartInfo part,
                                 Object source, 
-                                AttachmentMarshaller am, String encoding) {
+                                AttachmentMarshaller am) {
         Class<?> cls = null;
         if (part != null) {
             cls = part.getTypeClass();
@@ -103,10 +103,6 @@
                 // generate the xml declaration.
                 u.setProperty(Marshaller.JAXB_FRAGMENT, true);
                 u.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, false);
-                
-                if (encoding != null) {
-                    u.setProperty(Marshaller.JAXB_ENCODING, encoding);
-                }
             } catch (javax.xml.bind.PropertyException e) {
                 // intentionally empty.
             }
@@ -162,14 +158,14 @@
     }
 
     public static void marshall(JAXBContext context, Schema schema, Object elValue, Object
source) {
-        marshall(context, schema, elValue, null, source, null, null);
+        marshall(context, schema, elValue, null, source, null);
     }
 
     public static void marshall(JAXBContext context, Schema schema, 
                                 Object elValue, 
                                 MessagePartInfo part,
                                 Object source) {
-        marshall(context, schema, elValue, part, source, null, null);
+        marshall(context, schema, elValue, part, source, null);
     }
 
     private static Unmarshaller createUnmarshaller(JAXBContext context, Class<?> cls)
throws JAXBException {

Modified: incubator/cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/io/DataWriterImpl.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/io/DataWriterImpl.java?view=diff&rev=546956&r1=546955&r2=546956
==============================================================================
--- incubator/cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/io/DataWriterImpl.java
(original)
+++ incubator/cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/io/DataWriterImpl.java
Wed Jun 13 10:00:22 2007
@@ -27,8 +27,6 @@
 import org.apache.cxf.service.model.MessagePartInfo;
 
 public class DataWriterImpl<T> extends JAXBDataBase implements DataWriter<T>
{
-    private String encoding;
-    
     public DataWriterImpl(JAXBContext ctx) {
         setJAXBContext(ctx);
     }
@@ -40,16 +38,7 @@
     public void write(Object obj, MessagePartInfo part, T output) {
         if (obj != null) {
             JAXBEncoderDecoder.marshall(getJAXBContext(), getSchema(), obj, part, output,

-                                        getAttachmentMarrshaller(), encoding);
+                                        getAttachmentMarrshaller());
         }
     }
-
-    public String getEncoding() {
-        return encoding;
-    }
-
-    public void setEncoding(String encoding) {
-        this.encoding = encoding;
-    }
-    
 }



Mime
View raw message