summaryrefslogtreecommitdiffstats
path: root/java/sca/modules/databinding-json
diff options
context:
space:
mode:
authorrfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68>2009-10-07 20:52:32 +0000
committerrfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68>2009-10-07 20:52:32 +0000
commitc9ff2401831abb38a120ce7512862ca737de94ca (patch)
treefb25cc6d5e76806b19c35142ee97bbc82399a6bf /java/sca/modules/databinding-json
parentdfa48b369187a71c6d2966992bacf74d7017cbc2 (diff)
Upgrade to jabsorb 1.3.1 (json-rpc) and jettision 1.1
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@822905 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to '')
-rw-r--r--java/sca/modules/databinding-json/META-INF/MANIFEST.MF9
-rw-r--r--java/sca/modules/databinding-json/pom.xml9
-rw-r--r--java/sca/modules/databinding-json/src/main/java/org/apache/tuscany/sca/databinding/json/JSON2JavaBean.java5
-rw-r--r--java/sca/modules/databinding-json/src/main/java/org/apache/tuscany/sca/databinding/json/JSONHelper.java6
-rw-r--r--java/sca/modules/databinding-json/src/main/java/org/apache/tuscany/sca/databinding/json/JavaBean2JSON.java7
5 files changed, 16 insertions, 20 deletions
diff --git a/java/sca/modules/databinding-json/META-INF/MANIFEST.MF b/java/sca/modules/databinding-json/META-INF/MANIFEST.MF
index b8c7326487..21024b3efd 100644
--- a/java/sca/modules/databinding-json/META-INF/MANIFEST.MF
+++ b/java/sca/modules/databinding-json/META-INF/MANIFEST.MF
@@ -1,6 +1,6 @@
Manifest-Version: 1.0
-Export-Package: org.apache.tuscany.sca.databinding.json,
- org.apache.tuscany.sca.databinding.json.axiom
+Export-Package: org.apache.tuscany.sca.databinding.json;version="2.0.0",
+ org.apache.tuscany.sca.databinding.json.axiom;version="2.0.0"
Tool: Bnd-0.0.357
Bundle-Name: Apache Tuscany SCA Data Binding for JSON
Created-By: 1.6.0_15 (Apple Inc.)
@@ -10,8 +10,7 @@ Bnd-LastModified: 1254338075268
Bundle-ManifestVersion: 2
Bundle-License: http://www.apache.org/licenses/LICENSE-2.0.txt
Bundle-Description: Apache Tuscany SCA Data Binding for JSON
-Import-Package: com.metaparadigm.jsonrpc,
- javax.xml.namespace,
+Import-Package: javax.xml.namespace,
javax.xml.stream,
org.apache.axiom.om,
org.apache.tuscany.sca.common.xml.stax;version="2.0.0",
@@ -25,6 +24,8 @@ Import-Package: com.metaparadigm.jsonrpc,
org.codehaus.jettison.badgerfish,
org.codehaus.jettison.json,
org.codehaus.jettison.mapped,
+ org.jabsorb,
+ org.jabsorb.serializer,
org.json,
org.oasisopen.sca.annotation;version="2.0.0"
Bundle-SymbolicName: org.apache.tuscany.sca.databinding.json
diff --git a/java/sca/modules/databinding-json/pom.xml b/java/sca/modules/databinding-json/pom.xml
index 4afdbe90ff..b4616ad361 100644
--- a/java/sca/modules/databinding-json/pom.xml
+++ b/java/sca/modules/databinding-json/pom.xml
@@ -48,16 +48,15 @@
</dependency>
<dependency>
- <groupId>com.metaparadigm</groupId>
- <artifactId>json-rpc</artifactId>
- <version>1.0</version>
- <scope>compile</scope>
+ <groupId>org.jabsorb</groupId>
+ <artifactId>jabsorb</artifactId>
+ <version>1.3.1</version>
</dependency>
<dependency>
<groupId>org.codehaus.jettison</groupId>
<artifactId>jettison</artifactId>
- <version>1.0.1</version>
+ <version>1.1</version>
<scope>compile</scope>
<exclusions>
<exclusion>
diff --git a/java/sca/modules/databinding-json/src/main/java/org/apache/tuscany/sca/databinding/json/JSON2JavaBean.java b/java/sca/modules/databinding-json/src/main/java/org/apache/tuscany/sca/databinding/json/JSON2JavaBean.java
index b1813c9eab..a9edc66ae8 100644
--- a/java/sca/modules/databinding-json/src/main/java/org/apache/tuscany/sca/databinding/json/JSON2JavaBean.java
+++ b/java/sca/modules/databinding-json/src/main/java/org/apache/tuscany/sca/databinding/json/JSON2JavaBean.java
@@ -23,9 +23,8 @@ import org.apache.tuscany.sca.databinding.PullTransformer;
import org.apache.tuscany.sca.databinding.TransformationContext;
import org.apache.tuscany.sca.databinding.TransformationException;
import org.apache.tuscany.sca.databinding.javabeans.JavaBeansDataBinding;
-
-import com.metaparadigm.jsonrpc.JSONSerializer;
-import com.metaparadigm.jsonrpc.SerializerState;
+import org.jabsorb.JSONSerializer;
+import org.jabsorb.serializer.SerializerState;
/**
* @version $Rev$ $Date$
diff --git a/java/sca/modules/databinding-json/src/main/java/org/apache/tuscany/sca/databinding/json/JSONHelper.java b/java/sca/modules/databinding-json/src/main/java/org/apache/tuscany/sca/databinding/json/JSONHelper.java
index fb29710506..bc6184189a 100644
--- a/java/sca/modules/databinding-json/src/main/java/org/apache/tuscany/sca/databinding/json/JSONHelper.java
+++ b/java/sca/modules/databinding-json/src/main/java/org/apache/tuscany/sca/databinding/json/JSONHelper.java
@@ -19,8 +19,6 @@
package org.apache.tuscany.sca.databinding.json;
-import java.text.ParseException;
-
import org.codehaus.jettison.json.JSONException;
import org.codehaus.jettison.json.JSONObject;
@@ -61,7 +59,7 @@ public class JSONHelper {
if (source instanceof JSONObject) {
try {
json = new org.json.JSONObject(((JSONObject)source).toString());
- } catch (ParseException e) {
+ } catch (org.json.JSONException e) {
throw new IllegalArgumentException(e);
}
} else if (source instanceof org.json.JSONObject) {
@@ -83,7 +81,7 @@ public class JSONHelper {
}
try {
return type.cast(new org.json.JSONObject(json));
- } catch (ParseException e) {
+ } catch (org.json.JSONException e) {
throw new IllegalArgumentException(e);
}
}
diff --git a/java/sca/modules/databinding-json/src/main/java/org/apache/tuscany/sca/databinding/json/JavaBean2JSON.java b/java/sca/modules/databinding-json/src/main/java/org/apache/tuscany/sca/databinding/json/JavaBean2JSON.java
index a928deef22..0d52c66e17 100644
--- a/java/sca/modules/databinding-json/src/main/java/org/apache/tuscany/sca/databinding/json/JavaBean2JSON.java
+++ b/java/sca/modules/databinding-json/src/main/java/org/apache/tuscany/sca/databinding/json/JavaBean2JSON.java
@@ -24,9 +24,8 @@ import org.apache.tuscany.sca.databinding.TransformationContext;
import org.apache.tuscany.sca.databinding.TransformationException;
import org.apache.tuscany.sca.databinding.impl.BaseTransformer;
import org.apache.tuscany.sca.databinding.javabeans.JavaBeansDataBinding;
-
-import com.metaparadigm.jsonrpc.JSONSerializer;
-import com.metaparadigm.jsonrpc.SerializerState;
+import org.jabsorb.JSONSerializer;
+import org.jabsorb.serializer.SerializerState;
public class JavaBean2JSON extends BaseTransformer<Object, Object> implements PullTransformer<Object, Object> {
private JSONSerializer serializer;
@@ -68,7 +67,7 @@ public class JavaBean2JSON extends BaseTransformer<Object, Object> implements Pu
}
SerializerState state = new SerializerState();
- return serializer.marshall(state, source);
+ return serializer.marshall(state, null, source, new Integer(0));
}
public Object transform(Object source, TransformationContext context) {