cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r696449 - in /cxf/branches/2.1.x-fixes: ./ rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/basic/ rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/ rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/services/
Date Wed, 17 Sep 2008 21:17:26 GMT
Author: dkulp
Date: Wed Sep 17 14:17:25 2008
New Revision: 696449

URL: http://svn.apache.org/viewvc?rev=696449&view=rev
Log:
Merged revisions 691338 via svnmerge from 
https://svn.apache.org/repos/asf/cxf/trunk

........
  r691338 | bimargulies | 2008-09-02 14:15:05 -0400 (Tue, 02 Sep 2008) | 2 lines
  
  When not using 'soap encoding', map Character objects to xsd:strings.
........

Added:
    cxf/branches/2.1.x-fixes/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/basic/CharacterAsStringType.java
      - copied, changed from r691338, cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/basic/CharacterAsStringType.java
Modified:
    cxf/branches/2.1.x-fixes/   (props changed)
    cxf/branches/2.1.x-fixes/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/AbstractAegisTest.java
    cxf/branches/2.1.x-fixes/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/services/SimpleBean.java

Propchange: cxf/branches/2.1.x-fixes/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Sep 17 14:17:25 2008
@@ -1 +1 @@
-/cxf/trunk:686333-686363,686764,686820,687096,687194,687363,687387,687463,687543,687722,687798,687814,687817,687891,687910,687914,688086,688102,688133,688596,688735,688870,689572,689596,689855,689924,690067,690289,691246,691271,691295,691355,691488,691602,691646,691706,691728,692116,692157,692310,692466,692499,693653,693819,694179,694263,694417,694716,694744,694747,694795,694869,694981,694987,694993,695041,695096,695396,695484,695537,695552,695561,695619,695684,695835,695840,695868,695935,695977,696433
+/cxf/trunk:686333-686363,686764,686820,687096,687194,687363,687387,687463,687543,687722,687798,687814,687817,687891,687910,687914,688086,688102,688133,688596,688735,688870,689572,689596,689855,689924,690067,690289,691246,691271,691295,691338,691355,691488,691602,691646,691706,691728,692116,692157,692310,692466,692499,693653,693819,694179,694263,694417,694716,694744,694747,694795,694869,694981,694987,694993,695041,695096,695396,695484,695537,695552,695561,695619,695684,695835,695840,695868,695935,695977,696433

Propchange: cxf/branches/2.1.x-fixes/
------------------------------------------------------------------------------
--- svnmerge-blocked (original)
+++ svnmerge-blocked Wed Sep 17 14:17:25 2008
@@ -1 +1 @@
-/cxf/trunk:686343,686370,686382,686529,687783,688593,688791-688792,688868,689458,689929,691148,691237,691247,691338,691343,691348,691365,691367,691505,691511,692229
+/cxf/trunk:686343,686370,686382,686529,687783,688593,688791-688792,688868,689458,689929,691148,691237,691247,691343,691348,691365,691367,691505,691511,692229

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

Copied: cxf/branches/2.1.x-fixes/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/basic/CharacterAsStringType.java
(from r691338, cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/basic/CharacterAsStringType.java)
URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/basic/CharacterAsStringType.java?p2=cxf/branches/2.1.x-fixes/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/basic/CharacterAsStringType.java&p1=cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/basic/CharacterAsStringType.java&r1=691338&r2=696449&rev=696449&view=diff
==============================================================================
--- cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/basic/CharacterAsStringType.java
(original)
+++ cxf/branches/2.1.x-fixes/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/basic/CharacterAsStringType.java
Wed Sep 17 14:17:25 2008
@@ -19,6 +19,8 @@
 
 package org.apache.cxf.aegis.type.basic;
 
+import javax.xml.namespace.QName;
+
 import org.apache.cxf.aegis.Context;
 import org.apache.cxf.aegis.DatabindingException;
 import org.apache.cxf.aegis.type.Type;
@@ -30,20 +32,20 @@
  */
 public class CharacterAsStringType extends Type {
     
-    private StringType stringType;
+    public static final QName CHARACTER_AS_STRING_TYPE_QNAME 
+        = new QName("http://cxf.apache.org/aegisTypes", "char");
+    
+    private IntType intType;
     
     public CharacterAsStringType() {
-        stringType = new StringType();
+        intType = new IntType();
     }
 
     /** {@inheritDoc}*/
     @Override
     public Object readObject(MessageReader reader, Context context) throws DatabindingException
{
-        String string = (String)stringType.readObject(reader, context);
-        if (string.length() == 0) {
-            return Character.valueOf((char)0);
-        }
-        return new Character(string.charAt(0));
+        Integer readInteger = (Integer)intType.readObject(reader, context);
+        return new Character((char)readInteger.intValue());
     }
 
     /** {@inheritDoc}*/
@@ -51,6 +53,12 @@
     public void writeObject(Object object, MessageWriter writer, Context context) 
         throws DatabindingException {
         Character charObject = (Character) object;
-        stringType.writeObject(charObject.toString(), writer, context);
+        intType.writeObject(Integer.valueOf(charObject.charValue()), writer, context);
+    }
+
+    @Override
+    public boolean usesUtilityTypes() {
+        return true;
     }
+
 }

Modified: cxf/branches/2.1.x-fixes/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/AbstractAegisTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/AbstractAegisTest.java?rev=696449&r1=696448&r2=696449&view=diff
==============================================================================
--- cxf/branches/2.1.x-fixes/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/AbstractAegisTest.java
(original)
+++ cxf/branches/2.1.x-fixes/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/AbstractAegisTest.java
Wed Sep 17 14:17:25 2008
@@ -30,6 +30,7 @@
 
 import org.w3c.dom.Document;
 import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
 
 import org.apache.cxf.Bus;
 import org.apache.cxf.BusException;
@@ -221,10 +222,10 @@
         assertXPathEquals(xpath, value, doc);
     }
     
-    protected void assertValid(String xpath, Element element) throws Exception {
+    protected NodeList assertValid(String xpath, Element element) throws Exception {
         org.w3c.dom.Document doc = new DOMOutputter().output(element.getDocument());
         
-        assertValid(xpath, doc);
+        return assertValid(xpath, doc);
     }
 
     protected void assertInvalid(String xpath, Element element) throws Exception {

Modified: cxf/branches/2.1.x-fixes/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/services/SimpleBean.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/services/SimpleBean.java?rev=696449&r1=696448&r2=696449&view=diff
==============================================================================
--- cxf/branches/2.1.x-fixes/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/services/SimpleBean.java
(original)
+++ cxf/branches/2.1.x-fixes/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/services/SimpleBean.java
Wed Sep 17 14:17:25 2008
@@ -29,6 +29,8 @@
     private String howdy;
     
     private int[] numbers;
+    
+    private Character character;
     private char primitiveCharacter;
 
     public int[] getNumbers() {
@@ -65,6 +67,14 @@
         this.howdy = howdy;
     }
 
+    public Character getCharacter() {
+        return character;
+    }
+
+    public void setCharacter(Character character) {
+        this.character = character;
+    }
+
     public char getPrimitiveChar() {
         return primitiveCharacter;
     }



Mime
View raw message