summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Taal2013-02-18 15:04:07 (EST)
committer Martin Taal2013-02-18 15:04:07 (EST)
commit2a47c29fa295f3f6941b5a169019545ffdbb9a32 (patch)
treec097ff4049e3e21d3e949e997fe1e922128d36b6
parentb468142d48d750af77b09e4c94e4f414f35889b6 (diff)
downloadorg.eclipse.emf.texo-2a47c29fa295f3f6941b5a169019545ffdbb9a32.zip
org.eclipse.emf.texo-2a47c29fa295f3f6941b5a169019545ffdbb9a32.tar.gz
org.eclipse.emf.texo-2a47c29fa295f3f6941b5a169019545ffdbb9a32.tar.bz2
Added after read method
-rw-r--r--core/org.eclipse.emf.texo.json/src/org/eclipse/emf/texo/json/JSONEObjectStore.java18
1 files changed, 14 insertions, 4 deletions
diff --git a/core/org.eclipse.emf.texo.json/src/org/eclipse/emf/texo/json/JSONEObjectStore.java b/core/org.eclipse.emf.texo.json/src/org/eclipse/emf/texo/json/JSONEObjectStore.java
index c1d9bb4..0a05a86 100644
--- a/core/org.eclipse.emf.texo.json/src/org/eclipse/emf/texo/json/JSONEObjectStore.java
+++ b/core/org.eclipse.emf.texo.json/src/org/eclipse/emf/texo/json/JSONEObjectStore.java
@@ -100,7 +100,18 @@ public class JSONEObjectStore extends EObjectStore {
sb.append(line + "\n");
}
rd.close();
- return sb.toString();
+
+ return afterRead(conn, sb.toString());
+ }
+
+ /**
+ * Is called after the read of information has finished but before it is returned. The default implementation returns
+ * the string unaltered.
+ *
+ * @return the content
+ */
+ protected String afterRead(HttpURLConnection conn, String content) {
+ return content;
}
/**
@@ -133,7 +144,6 @@ public class JSONEObjectStore extends EObjectStore {
toInsert.removeAll(toDelete);
toUpdate.removeAll(toInsert);
-
// create a temporary proxy uri for the to insert ones
// do this before the copyAll below
// this ensures that the references are handled correctly
@@ -158,8 +168,8 @@ public class JSONEObjectStore extends EObjectStore {
// get the id of the inserted objects and link the previous eobject to them
// don't convert the outer object, otherwise the inner objects
// will have a change in container
- final JSONArray insertedJsonArray = jsonObject.getJSONArray(ResponsePackage.eINSTANCE
- .getResultType_Inserted().getName());
+ final JSONArray insertedJsonArray = jsonObject.getJSONArray(ResponsePackage.eINSTANCE.getResultType_Inserted()
+ .getName());
int i = 0;
for (EObject insertedEObject : toInsert) {