ace-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j...@apache.org
Subject svn commit: r1308115 - /ace/trunk/ace-client-rest/src/main/java/org/apache/ace/client/rest/RepositoryObjectSerializer.java
Date Sun, 01 Apr 2012 13:44:17 GMT
Author: jawi
Date: Sun Apr  1 13:44:17 2012
New Revision: 1308115

URL: http://svn.apache.org/viewvc?rev=1308115&view=rev
Log:
ACE-243: add the definition of a repository object to its JSON representation.

Modified:
    ace/trunk/ace-client-rest/src/main/java/org/apache/ace/client/rest/RepositoryObjectSerializer.java

Modified: ace/trunk/ace-client-rest/src/main/java/org/apache/ace/client/rest/RepositoryObjectSerializer.java
URL: http://svn.apache.org/viewvc/ace/trunk/ace-client-rest/src/main/java/org/apache/ace/client/rest/RepositoryObjectSerializer.java?rev=1308115&r1=1308114&r2=1308115&view=diff
==============================================================================
--- ace/trunk/ace-client-rest/src/main/java/org/apache/ace/client/rest/RepositoryObjectSerializer.java
(original)
+++ ace/trunk/ace-client-rest/src/main/java/org/apache/ace/client/rest/RepositoryObjectSerializer.java
Sun Apr  1 13:44:17 2012
@@ -39,6 +39,8 @@ import com.google.gson.JsonSerializer;
 public class RepositoryObjectSerializer implements JsonSerializer<RepositoryObject>
{
 
     /** used in all repository objects. */
+    private static final String DEFINITION = "definition";
+    /** used in all repository objects. */
     private static final String TAGS = "tags";
     /** used in all repository objects. */
     private static final String ATTRIBUTES = "attributes";
@@ -80,7 +82,10 @@ public class RepositoryObjectSerializer 
      */
     private JsonElement serializeStatefulTargetObject(StatefulTargetObject targetObject)
{
         JsonObject result = new JsonObject();
-        // first add all attributes
+        // ACE-243: first all the definition...
+        result.addProperty(DEFINITION, targetObject.getDefinition());
+
+        // then add all attributes
         JsonObject attr = new JsonObject();
 
         if (targetObject.isRegistered()) {
@@ -151,7 +156,10 @@ public class RepositoryObjectSerializer 
      */
     private JsonElement serializeRepositoryObject(RepositoryObject repositoryObject) {
         JsonObject result = new JsonObject();
-        // first add all attributes
+        // ACE-243: first all the definition...
+        result.addProperty(DEFINITION, repositoryObject.getDefinition());
+        
+        // then add all attributes
         JsonObject attr = new JsonObject();
         
         Enumeration<String> keys = repositoryObject.getAttributeKeys();



Mime
View raw message